Subject: Value of _PATH replaces PATH in shell scripts! Why?
From: [email-masked] (Fran Litterio)

3 Jan 1997 16:24:13 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <c=US%a=_%p=Amulet._Inc.%l=[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "[email-masked]'" <[email-masked]>
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63
Original-Sender: [email-masked]

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
[email-masked]

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".