Re: Use of if and test in .qmail files
Bruce Guenter <[email protected]> Tue, 30 Oct 2007 11:45:45 -0600
| Newsgroups | gmane.mail.ezmlm |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Oct 30, 2007 at 01:39:41PM -0400, Paul Jarc wrote: > test -f is older. Solaris sh's builtin test doesn't have -e. So noted, thanks. > Bruce Guenter <[email protected]> wrote: > > | 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 Only if you don't care about the exit code from ezmlm-archive. There are some cases where the exit code is required, for example when choosing between ezmlm-store and ezmlm-gate. > But "if" is more readable anyway. Much, yes. If it is considered adequately portable, I'll just use that. -- Bruce Guenter <[email protected]> http://untroubled.org/ I do custom software development. Email me for details.
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFHJ23J6W+y3GmZgOgRArUmAJ9M6Q/rh/QBw4lJVTnerPG3uIfFsgCeL0QR byIAr/s6CdTuR1/BTNrLX5Y= =DIME -----END PGP SIGNATURE-----