Annoying sudo change?

Tom Horsley tom.horsley at att.net
Fri Dec 12 12:27:40 UTC 2008


On Fri, 12 Dec 2008 22:29:44 +1030
Tim wrote:

> Using the full path to commands has always been common advice for
> including them in scripts.  Sure, there are probably times when that has
> it's problems, too.  But nothing's perfect.

Until you try to run the same script on a distro like ubuntu where
you find "sort" in /usr/bin instead of /bin :-).

The advice I've always used is to explicitly set PATH to a safe
value at the start of the script, then it can deal with variations
like /bin versus /usr/bin with no changes and a lot less typing
in the rest of the script (until sudo drops one of the PATH components :-).




More information about the fedora-list mailing list