Multiple executables in path (Was: NON-SOURCE POSTINGS CONSIDERED HARMFUL!)

Paul Falstad pfalstad at phoenix.Princeton.EDU
Wed Jan 23 11:53:50 AEST 1991


chet at po.CWRU.Edu wrote:
>In article <5570 at idunno.Princeton.EDU> pfalstad at phoenix.Princeton.EDU (Paul Falstad) writes:
>>tchrist at convex.COM (Tom Christiansen) wrote:
>>>From the keyboard of kaul at icarus.eng.ohio-state.edu (Rich Kaul):
>>>That's odd -- if you have unexpanded tildes in your environment,
>>>I wonder how you get system, popen, and execlp to work without
>>>changing the C library.
>>You don't, it seems.  At least it didn't work for me.  This is probably
>>a bug in bash.  You should use $HOME instead of ~ when you define
>>your PATH.

>You have to go through special pains to get an unexpanded tilde in
>your PATH, since tilde expansion is performed on the rhs of assignment
>statements.  The only way you can get a tilde into your path is to
>surround it with quotes.  It might be a bug that double quotes can
>inhibit the expansion.

Well, you might have fixed it in the CWRU version, but my version
(1.05.1) has the bug.  Perhaps I need an update.  But I would hardly
call the following script "going through special pains."

Script started on Tue Jan 22 19:48:33 1991
warning: could not update utmp entry
Z 1 phoenix:~/src/zsh echo $PATH
/n/uffda/b/pfalstad/scr:/u/pfalstad/bin/sun4:/usr/princeton/bin:/usr/ucb:/usr/bi
n:/bin:/u/maruchck/scr:/u/cs320/bin:/u/subbarao/bin:/u/maruchck/bin:/usr/hosts:/
usr/princeton/bin/X11:/usr/etc:/etc
Z 2 phoenix:~/src/zsh bash
bash$ echo $PATH
/n/uffda/b/pfalstad/scr:/u/pfalstad/bin/sun4:/usr/princeton/bin:/usr/ucb:/usr/bi
n:/bin:/u/maruchck/scr:/u/cs320/bin:/u/subbarao/bin:/u/maruchck/bin:/usr/hosts:/
usr/princeton/bin/X11:/usr/etc:/etc
bash$ PATH=~/scr:~/bin/sun4:/usr/princeton/bin:/usr/ucb:/usr/bin:/bin:~maruchck
/scr:~cs320/bin:~subbarao/bin:~maruchck/bin:/usr/hosts:/usr/princeton/bin/X11:/
usr/etc:/etc
bash$ echo $PATH
/n/uffda/b/pfalstad/scr:~/bin/sun4:/usr/princeton/bin:/usr/ucb:/usr/bin:/bin:~ma
ruchck/scr:~cs320/bin:~subbarao/bin:~maruchck/bin:/usr/hosts:/usr/princeton/bin/
X11:/usr/etc:/etc
bash$ Z 3 phoenix:~/src/zsh exit

script done on Tue Jan 22 19:49:30 1991


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.

--
Paul Falstad, pfalstad at phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
In the heat of composition I find that I have inadvertently allowed
myself to assume the form of a large centipede.  I am accordingly
dictating the rest to my secretary.



More information about the Alt.sources.d mailing list