On Fri, 5 Jun 2009, Wietse Venema wrote:
Victor Duchovni:
On Fri, Jun 05, 2009 at 10:05:16AM -0400, Wietse Venema wrote:
Ralf Hildebrandt:
/usr/libexec/postfix/postfix-script: 346: /bin/env: not found
Replace "/bin/env find" by "`which find`.
Perhaps /usr/bin/env, will be more portable? It seems that /usr/bin/env
is "more" correct than /bin/env for both Linux and Solaris, does it
also work on *BSD systems? Also "find" is /usr/bin/find on both.
/usr/bin/env is the "preferred" location, but this isn't really written in
stone anywhere. For further confusion, some Linux distributors ship
/usr/bin/env as a link to /bin/env, presumably to cover the unusual case
of separate / and /usr partitions and no initrd.
Why is a hard-coded command path better than `which find`? The
script runs with a PATH setting that is controlled by Postfix (it
would be a bug otherwise).
Surprisingly enough, which isn't a standard utility -- and it's not
installed by default in the "minimal" package sets on several platforms,
mostly Linux variants. (Yes, this is annoying.)
/usr/bin/env is probably the safest bet here. Isn't portability fun?
-Rob