Subject: b17.1 - bash confused by directory name = script name
From: [email-masked] (Richard Donkin)

22 Dec 1996 15:37:03 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Original-To: [email-masked]
Original-Cc: [email-masked]
Original-Sender: [email-masked]

I have a shell script called 'man' that is in the path and works fine from 
bash unless the current working directory has a directory called 'man' 
within it.  For example:

chanrossa(1) rcs-5.7$ pwd
/usr/local/src/rcs-5.7
chanrossa(1) rcs-5.7$ ls -ld man
drwxr-xr-x  32 500      everyone        0 Jan 01  1970 man
chanrossa(1) rcs-5.7$ type -a man
man is /USR/LOCAL/BIN/man
chanrossa(1) rcs-5.7$ head -3 /usr/local/bin/man
#!/bin/sh
# man: show man page
set -x
chanrossa(1) rcs-5.7$ man diff3
man: man: Permission denied
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: bash seems to find the shell script OK, then somehow when starting up 
the subshell finds the directory ./man and tries to open this as the shell 
script.

chanrossa(1) rcs-5.7$ cd /usr
chanrossa(1) /usr$ ls -ld man
/unix/h-i386-cygwin32/bin/ls: man: No such file or directory
chanrossa(1) /usr$ man diff3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: man script gets invoked correctly since ./man directory does not exist 
here.

PATH setting is:

/USR/LOCAL/BIN:/UNIX/H-I386-CYGWIN32/BIN:.:/BIN:/d/PERL/BIN:/d/WIN95:/d/WIN95
/COMMAND:/DOS:/DEVEL/CAFE/BIN:/DEVEL/CAFE/JAVA/BIN

The odd thing is that even if bash was searching the path again for the 
subshell it should still find the /usr/local/bin/man script first, not the 
../man directory.

Richard
--
[email-masked]                http://www.inside-edge.co.uk/
Inside Edge Consultancy           Client/Server and Internet Applications
PGP key from:  [email-masked]  -or-  http://www.four11.com/

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