Path: utzoo!utgpu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!usenet.rpi.edu!tale From: tale@rpi.edu (David C Lawrence) Newsgroups: alt.sources.d Subject: Re: Multiple executables in path Message-ID: Date: 25 Jan 91 08:58:25 GMT References: <1991Jan22.053747.14144@convex.com> <5570@idunno.Princeton.EDU> <1991Jan22.220246.9920@usenet.ins.cwru.edu> <5612@idunno.Princeton.EDU> Organization: Rensselaer Polytechnic Institute Computer Science, Troy NY Lines: 21 Nntp-Posting-Host: cs.rpi.edu In <5612@idunno.Princeton.EDU> pfalstad@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@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))