I'd written,
T> BTW, I'm greatly in favor of setting PATH and calling executables by their
T> basenames over setting variables for every executable's absolute path and
T> invoking them all by their variables.
Lars Hecking responded,
H> I am in favour of this, too, but it is not always possible in some
H> situations.
H> 1. PATH=dir1:dir2
H> prog1 and prog2 exist in both dir1 and dir2, and you want
H> to use prog1 from dir1 and prog2 from dir2.
H> 2. I need the follwoing workaround for buggy fgrep on Solaris
H> GNU=/usr/local/gnu
H> FGREP="`if [ -x $GNU/bin/fgrep ] ; then echo $GNU ; elif [ -x
/usr/xpg4/bin/fgrep ] ; then echo /usr/xpg4 ; else : ; fi`/bin/fgrep"
H> If GNU fgrep exists on the machine procmail is running on, use it.
H> Else, use /usr/xpg4/bin/fgrep. Only if neither exists, use /bin/fgrep.
H> Of course, I could simply go and hardwire /usr/xpg4/bin/fgrep ...
My perspective is different; I am not setting things up for all users of a
system, only for myself, because I am a user wherever I have accounts, never
a sysadmin. My .procmailrc PATH and my interactive shell PATH are going to
be the same, and ~dattier/priority will always be ahead of the system
executables' directories and ~dattier/binary after them. The original
purposes of those two directories ("binary" has all six letters in its name
because often /etc/profile or whatever will stick $HOME/bin into $PATH, and
a user never can predict from one system to another whether it will be at the
beginning or the end, so I eschew that name as having inconsistent results)
were so that I could do this in my own ~/.profile and ~/.procmailrc:
PATH=$HOME/priority:$HOME/firstscripts:$PATH:$HOME/binary:$HOME/scripts
The priority and firstscripts directories are for executables that I want to
supersede those supplied by the sysadmin in the directories in /etc/profile's
$PATH. The binary and scripts directories are for those where I'm waiting
for the sysadmin to install the programs, and I want to be sure that when
that day arrives the system copies supersede my own. When there are no name
conflicts, I put them into binary or scripts; that way, if I've picked a name
that normally belongs to something else, I'll get the wrong program, learn
that I picked a poor name for my own executable, and give it a new name.
The side benefit was that, if the system executable directories have two
versions of a given program, and I want the one that's later in $PATH, I can
symlink the version I prefer into ~/priority or ~/firstscripts. Then typing
its basename gets me the one I want, even in the situations Lars listed where
invocation by basename doesn't work for him.
Because I'm working at the user level, not at the sysadmin level, my problem
and my solution are both different from Lars's.
David W. Tamkin dattier(_at_)mcs(_dot_)net
dattier(_at_)yahoo(_dot_)com
Private parking, Sorcerers' Union Hall: unauthorized vehicles will be toads.