[gnu.bash.bug] Bug in 1.02 bash CDPATH handling

jkh@pcsbst.UUCP (jkh) (08/04/89)

Assuming that I've got a directory somewhere in my CDPATH called "foo"
and a subdirectory under the current directory called "foo", isn't it
logical to expect a "cd foo" to prefer the subdirectory? This is
the way it works in our C-shell. It's kind of disconcerting to get
suddenly boinked halfway across the filesystem when you were simply
trying to enter a directory right in front of you. I thought CDPATH
was only searched if the simple case failed?

				Jordan

-- 
--------
				Jordan Hubbard
				PCS Computer Systeme GmbH
				West Germany
	UUCP:			{uunet,decwrl}!pyramid!pcsbst!jkh
	ARPA:			jkh@violet.berkeley.edu

Hey! Leave that alone!

bfox@AUREL.CALTECH.EDU (Brian Fox) (08/06/89)

   Date: 3 Aug 89 17:36:14 GMT
   From: mcvax!unido!pcsbst!jkh@uunet.uu.net  (jkh)
   Organization: PCS GmbH, Pfaelzer-Wald-Str. 36, 8000 Muenchen; West-Germany
   Sender: bug-bash-request@prep.ai.mit.edu

   Assuming that I've got a directory somewhere in my CDPATH called "foo"
   and a subdirectory under the current directory called "foo", isn't it
   logical to expect a "cd foo" to prefer the subdirectory? This is
   the way it works in our C-shell. It's kind of disconcerting to get
   suddenly boinked halfway across the filesystem when you were simply
   trying to enter a directory right in front of you. I thought CDPATH
   was only searched if the simple case failed?


CDPATH is checked first if it exists.  If you want the behaviour that
you didn't get, simple place "." in your CDPATH before anything else.
This is consistant with the way PATH works.  This is also more flexible
than the behaviour of Csh.

   CDPATH=.:$GNUSRC:$X11SRC

is the contents of my CDPATH variable.

Brian