Mail Archives: cygwin/1997/01/03/16:24:13
Recently I reported a problem where the value of PATH was corrupted in
all of my shell scripts and that I couldn't run scripts except by
explicit pathname (i.e., just typing "foo" would not run script foo -- I
had to type "bin/foo"). I've tracked it down to something wierd:
If your environment has the variable _PATH in it (note the
leading underscore), then the value of _PATH replaces the
value of PATH in shell scripts!
I was setting my NT path like so (using the Environment tab of the
System Properties dialog):
_PATH=c:\franl\bin;c:\winnt\system32;c:\winnt;c:\dos;c:\whatever
PATH=%_PATH%
This, combined with the above wierd behavior, was causing all of my
shell scripts to fail with this error
scriptname: scriptname: No such file or directory
which is the classic sign that the shell named in the #! line of the
script can't be found. But my scripts all start with #!/bin/sh, and I
have the cygwin32 bin directory mounted on /bin, and I have bash
installed as both /bin/bash.exe and /bin/sh.exe.
So I stopped setting _PATH in my NT environment, and I put this in my
bash startup file:
export _PATH="$PATH"
and all my shell scripts work again -- perfectly. I can even run them
without using explicit pathnames. Happiness.
But can anyone explain this _PATH thing? Is this an NT feature (the
MSDN CD had zero to say about it)? Or is bash/cygwin.dll causing this
behavior?
--
Francis Litterio
franl AT amulet DOT com
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -