B20.1 relative path names in PATH not working?

Rob Tulloh rob_tulloh@dev.tivoli.com
Tue Aug 31 23:49:00 GMT 1999


Is there a reason why a relative path in a PATH variable can't be
used to locate a command/script to be executed by bash/sh? Here
is an example of what I mean:

> bash-2.02$ cd i:/tmp
> bash-2.02$ ls foobar barfoo
> barfoo:
> foobar:
> foo
> bash-2.02$ foobar/foo
> hi there
> bash-2.02$ cd barfoo
> bash-2.02$ foo
> bash: foo: command not found
> bash-2.02$ echo $PATH
> /apps/work/cygnus/CYGWIN~1/H-I586~1/bin://C/WINNT40/system32://C/WINNT40:/apps/w
> ork/Personal_Communications:/apps/WinDbg/Bin:/apps/WinDbg/Bin/WinNT:/tools/msvc4
> bash-2.02$ PATH=$PATH:../foobar
> bash-2.02$ foo
> foo: Can't open foo
> bash-2.02$ ls /bin/sh
> /bin/sh
> bash-2.02$ cat ../foobar/foo
> #!/bin/sh
> echo hi there
> bash-2.02$ ../foobar/foo
> hi there
> bash-2.02$

It seems that bash sees the file, but cannot grok the #!/bin/sh 
or something like this. Notice the message changes after I added the
path to the PATH variable. It was 'command not found' before I
changed PATH. After PATH was updated, the message changed
to "foo: Can't open foo". I searched Users Guide, the FAQ, and
the mail archives for August and July and I do not see any 
information on restrictions on the use of relative paths. I tried
to search for "Can't open" in the search engine and didn't any
hits on that either. However, even simple queries for things
like PATH and path don't return results either. This makes me
think the search engine is broken or something :-(

Did I miss something important? Note that it is helpful to use
relative paths in places like a build environment when make
sets PATH each time it launches in a sub-directory relative
to fixed location.

Thank you,


Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

More information about the Cygwin mailing list