Re: Use of if and test in .qmail files
[email protected] (Paul Jarc) Tue, 30 Oct 2007 13:39:41 -0400
| Newsgroups | gmane.mail.ezmlm |
|---|---|
| Organization | What did you have in mind? A short, blunt, human pyramid? |
| Message-ID | <[email protected]> |
Bruce Guenter <[email protected]> wrote: > On Tue, Oct 30, 2007 at 01:05:32PM -0400, Paul Jarc wrote: >> test -f would be more portable than test -e, though. > > Really? That surprises me, as test -e is the simpler condition. test -f is older. Solaris sh's builtin test doesn't have -e. > | test -e DIR/threaded && ezmlm-archive DIR > > will cause all deliveries to fail if DIR/threaded does not exist, even > though the above is the most obvious conditional expression. As such, > the test must be negated. This would work: | test -e DIR/threaded && exec ezmlm-archive DIR; exit 0 But "if" is more readable anyway. paul