Notable bash $PATH behavior trivia

pll at lanminds.com pll at lanminds.com
Fri Jan 3 14:49:28 EST 2003


In a message dated: Fri, 03 Jan 2003 14:00:43 EST
Derek Martin said:

>It's even documented in the man page for Paul's beloved ksh 88:

Two things:

 1) it stands to reason that ksh, ksh88 and even pdksh
    would have this same behavior, since they're all direct descendants 
    of the original 'sh.  Also, the man page for 'ksh' under Linux DOES 
    document this behavior.

 2) I've been using bash at work for 9 months or so now :)
    (though I've had to re-implement via 'alias' what were previously
     ksh functions)

>It's not a bug.  Ben's description was dead-on.  If you stick a null
>path in front of a thing, you get the thing in the current
>directory...

And if you read the pdksh man page, it blatantly spells this out:

       PATH   A colon separated  list  of  directories  that  are
              searched  when  looking for commands and .'d files.
              An empty string resulting from a leading or  trail­
              ing  colon,  or two adjacent colons is treated as a
              `.', the current directory.

Though I can't fault mod for not reading the ksh man page wrt a 
problem he thought he was having with bash :)  Also, I've never 
encountered this behavior, since I've never had leading, trailing, or 
otherwise empty colons in my path, so I'd never considered it could 
be misleading :)
-- 

Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE

	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!





More information about the gnhlug-discuss mailing list