🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #616

Re: Bash-1.03 and exported PATH and history substitutions

#616
From: Gregory Bond
Date: Tue, 19 Sep 1989 00:08
63 lines
3328 bytes
   >From:  bfox%aurel.caltech.edu@murtoa.cs.mu.oz (Brian Fox)
   >Subject:  Bash-1.03 and exported PATH and history substitutions
   >Date:	Fri, 15 Sep 89 09:07:19 H

       Date: Thu, 14 Sep 89 19:05:36 +1000
       From: Gregory Bond <munnari!melba.bby.oz.au!gnb@uunet.uu.net>

       1) If you have a path line like
    	   PATH=:/bin:/usr/bin:~/bin:/usr/local/bin

          then when it is exported, the ~ is not expanded.  This confuses
          subsequent invocations of /bin/sh or other programs that parse
          paths, for example make.  Csh does expand components of the path it
          exports.

    Csh expands words beginning with whitespace.  It does not have to expand
    the components of PATH, which are separated by colons.  I could special
    case the PATH variable, which I think is ugly beyond belief. 

I agree, it's ugly.  However, some method of expanding ~name in
PATH-like variables would be nice.  I think a general-purpose
mechanism is required (for things like MANPATH etc), but I can't think
of any clean way to do this expansion using expr or test etc, nor can
I think of a method of constructing the PATH to expand at construction
time.  But some special operator is also ugly.  Perhaps a
string-concatenation operator: 
	PATH=:/bin:/usr/bin: + ~/bin + :rest:of:path
(In csh this happens because PATH is set using the csh space-separated
syntax.)

          This one annoys me a lot: you can't add slashes with ^.^./^ as

    Yes, you can.  Please try again.  Also, please specify the version of
    Bash (or better yet, readline) which is giving you the problem.  

Um, red faces time.  I checked this before posting, but must have
checked on the 1.02 shell (where it definitly didn't work). 


    I do not expect to spend any substantial amount of time hacking on the
    arcane and non-intuitive Csh !-style history interface.  I have already
    spent too much time as it is.

  	  I have started looking at
          these problems and may eventually produce a better history editor.

    If you produce a better history editor, which is clean, and provides the
    same interface as mine, I will be more than happy to make it a part of
    the Readline library.  Perhaps next time, you can spend the half hour
    adding the features that you want instead of me!

Better in the sense of more like csh - for many years of habit die
hard.  (The number of times I type <ESC> in bash and emacs to get file
completion... ).  Given the :gs stuff, the next thing I miss is & in
the replacement string.  I AM working on this, but it's a bit more
than 1/2 hour for someone who doesn't know the code.  This whole
history mechanism is nasty twisted job, full of odd surprises and dark
corners.  I can well understand the desire to leave it behind.

But, boy, I do love this shell.

Greg.  Bash fanatic.
Technical Details
Message-ID: <8909190008.AA11764@baby.bby.oz>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!melba.bby.oz.au!gnb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!melba.bby.oz.au!gnb
From: gnb@melba.bby.oz.au (Gregory Bond)
Newsgroups: gnu.bash.bug
Subject: Re: Bash-1.03 and exported PATH and history substitutions
Message-ID: <8909190008.AA11764@baby.bby.oz>
Date: 19 Sep 89 00:08:28 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 63