It is currently Tue, 07 Dec 2021 01:51:05 GMT



 
Author Message
 POSIX shell & $PATH

Hi,

Does anybody know, if POSIX 1003.2 defines behaviour of shell, which
is executed in environment where PATH variable is undefined.
Should POSIX shell set PATH to some value?

I mean, what should be returned by this command:
env - /bin/sh -c 'echo $PATH'

Regards,

Robert

--
  Robert Luberda  *  rob...@pingu.ii.uj.edu.pl  *  rob...@debian.org
    * GnuPG:  AEE0 1F85 3E63 8BAA CDF1 3D18 4E18 7570 9D30 9C3B *



 Sun, 20 Jul 2003 04:55:38 GMT   
 POSIX shell & $PATH

My understanding is that it should return nothing,
i.e., $PATH should be unset.

However, when PATH is unset sh should behave *as if* it had default
value (getconf PATH) and standard commands should still be found.
Only if PATH is set to null string (PATH='') would no path search take
place, and only special built-in commands would work.

Caveat: I don't really know what I'm talking about.
That is based on a rather old draft of POSIX.2 (1991).

--
Tapani Tarvainen



 Mon, 21 Jul 2003 02:02:58 GMT   
 POSIX shell & $PATH

It must have changed after that draft.  The published standard
says, "If PATH is unset or is set to null, the path search is
implementation defined."

--
Geoff Clare                         g...@unisoft.com
UniSoft Limited, London, England.   g...@root.co.uk



 Tue, 22 Jul 2003 04:49:56 GMT   
 
   [ 3 post ] 

Similar Threads

1. POSIX shell installation & where to get it

2. HPUX Posix shell history & resources

3. CDE & bash shell path issue

4. Posix Path

5. How the *&^#^&%# do you set the $PATH

6. Alias Throu LDAP && Case Insensitiv Paths

7. PATH=$(getconf PATH), but PATH for getconf?

8. ksh: add path to $PATH only when ot yet in $PATH

9. add in the PATH a path if not present in the PATH


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software