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

Rich Kaul kaul at icarus.eng.ohio-state.edu
Wed Jan 23 03:58:03 AEST 1991


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):
   >:with bash, where you can have a PATH with unexpanded ~ references in
   >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.

Hmmm, I beg to disagree.  Also, $HOME is not appropriate when
searching another user's directory, cf:

Script started on Tue Jan 22 08:45:16 1991
bash$ echo $PATH
/usr/1/kaul/bin:/usr/1/kaul/bin/sun3:/usr/bin/X11:/usr/local/gnu/bin:/usr/local/bin:~octtools/bin:~cad/bin:/usr/ucb:/usr/bin:/usr/etc:.
bash$ which magic
/usr/1/cad/bin/magic
bash$ magic

Magic - Version 6.3 - Last updated Thu Sep 13 13:21:25 PDT 1990  

Using technology "scmos".

> :quit
bash$ exit
exit

script done on Tue Jan 22 08:46:09 1991

(saying ~cad/bin/magic gives the same result).  Bash does the
expansion of the ~ before running the program.  It is possible to
force the expansions manually, but that's usually more work than
desired.  Besides, the ~ in bash has more functions than the
equivalent ~ in csh (see Chet Ramey's bash man page for more
information).

Obligatory plug for bash: it's worth it.  It's a very nice shell, with
full emacs editing and very good vi editing if that's your dialect.
It's certainly more fun than tcsh, which I used before, and has a more
POSIX-ified behavior.  There are still some bugs, although Chet's
version is nearly bug free, and version 1.06 is long overdue.  I liked
it so much, I use the shell (or something to that effect).
-- 
Rich Kaul                         | Every man is given the key to the door
kaul at icarus.eng.ohio-state.edu    | of heaven; unfortunately, the same key
or ...!osu-cis!kaul		  | opens the door to hell.



More information about the Alt.sources.d mailing list