Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!WATSNEW.WATERLOO.EDU!andrewt From: andrewt@WATSNEW.WATERLOO.EDU (Andrew Thomas) Newsgroups: gnu.bash.bug Subject: Order of operations for cdpath checking Message-ID: <8906141949.AA24443@watsnew.waterloo.edu> Date: 14 Jun 89 19:49:48 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 21 I am using bash 0.99 on a uVax II running Ultrix 2.0: in the following conditions: - there exists a directory /tmp/docs - there exists another dir /tmp/docs/docs - my pwd is /tmp/docs - my CDPATH = /tmp/ if I type bash> cd docs I end up in /tmp/docs, not /tmp/docs/docs. Basically, bash is checking the directories in CDPATH before my current directory. Is this intentional? This can be avoided by setting CDPATH to ./:/tmp/ but it forces this to be a conscious decision. tcsh uses cdpath as a list of directories to be searched only if the directory is not found in the pwd. Bash's behaviour is more general, but provides a trap for novice users, or people coming from tcsh-like shells. Andrew Thomas andrewt@watsnew.waterloo.edu Systems Design Eng. University of Waterloo "If a million people do a stupid thing, it's still a stupid thing." - Opus