On Thu, 2 May 2002, David W. Tamkin wrote:
Is there a way to test for a plain file's existence with procmail
Failing that, on a system where /bin/test is a shell script, what would you
folks recommend as a small, cheap-to-run fork that (1) can take a filename as
a positional parameter [so that there's no need to fork a shell to handle
"<"], (2) will exit with an error if the file doesn't exist. and (3) will not
read the whole blasted file if it does exist and is long. The best I can
think of is head -0.
head is very good idea. Maybe echo(1) is faster. Try this:
If the file exists the answer will be:
Else the answer will be:
Unfortunately, the status exit will be true in anycase, on the
other hand you can work with the builtin MATCH.
What about ls -d ? I know is biger than head but maybe more
procmail mailing list