bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CDPATH bug


From: Eric Blake
Subject: Re: CDPATH bug
Date: Mon, 01 Oct 2007 06:22:34 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Pierre Gaston on 10/1/2007 6:02 AM:
> from http://www.gnu.org/software/bash/manual/bashref.html#SEC85
> 
> 19. If `CDPATH' is set, the `cd' builtin will not implicitly append
>      the current directory to it.  This means that `cd' will fail if no
>      valid directory name can be constructed from any of the entries in
>      `$CDPATH', even if the a directory with the same name as the name
>      given as an argument to `cd' exists in the current directory.

Which is a bug in bash, because POSIX requires cd to behave as though
CDPATH implicitly ended with a directive for `.'.

http://www.opengroup.org/onlinepubs/009695399/utilities/cd.html
(also read the amended instructions at
http://www.opengroup.org/austin/interps/uploads/40/6230/AI-037.txt)

step 5 deals with CDPATH, and states:

"repeat this step with the next pathname in CDPATH until all pathnames
have been tested."

at which point, if CDPATH did not find a solution, the implementation MUST
move on to step 6:

"Set curpath to the string formed by the concatenation of the value of
PWD, a slash character, and the operand."

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHAOZ784KuGfSFAYARAhi6AJ9CQjwsvQalQOyfSICXm8R7rxwlWQCg14Zm
Ct0zY1qcET5LbrQsDB6wTHY=
=9F2W
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]