Multiple executables in path

David C Lawrence tale at rpi.edu
Fri Jan 25 19:58:25 AEST 1991


In <5612 at idunno.Princeton.EDU> pfalstad at phoenix.Princeton.EDU (Paul Falstad):

   The ~ is expanded only for the first component in the PATH, not for the
   remaining components.  Bash handles this fine, of course, but execlp
   does not.

Not only that, ~ also isn't _always_ expanded if first.  Try VAR=~:~.
It only seems to do it if ~ is followed by a username or by /.

Many moons ago I just decided to use this in every login shell
environment I had to set my environment variables:

function tilde { echo "$@" | /usr/bin/tr ' ' : }
PATH=`tilde ~tale/bin /usr/local/gnu/bin /usr/bin/X11 /usr/local/bin /usr/etc /usr/bin /usr/ucb /bin  /usr/5bin ~weltyc/bin .`

Used similary for MANPATH, TEXINPUTS, et cetera.

The "function" part has changed for each flavour of shell, but the
basic method is there.
--
   (setq mail '("tale at cs.rpi.edu" "tale at ai.mit.edu" "tale at rpitsmts.bitnet"))



More information about the Alt.sources.d mailing list