|
From: | Steven W. Orr |
Subject: | Re: minor bash man page "cd -" annoyance |
Date: | Wed, 27 Jul 2011 15:56:59 -0400 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 |
On 7/26/2011 10:45 PM, Jason Quinn wrote:
In the bash man page's section for "cd" it says An argument of - is equivalent to $OLDPWD. If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. The first sentence is potentially confusing as "cd -" is not 100% equivalent to "cd $OLDPWD". I would word the above as If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. An argument of - is otherwise equivalent to $OLDPWD. Jason
I'd like to pile on to this one. The pushd command should probably refer to the fact that the directory argument is the same as the cd command and honors CDPATH and -. There currently is no mention.
Two other nits:Nit A) The cd command (and pushd) do not complain when you give them too many arguments. (I have been bitten by this because of typos that did not generate complaints.)
Nit ii) The popd command also does not complain if you give it a filename. Am I being too nit picky. -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net
[Prev in Thread] | Current Thread | [Next in Thread] |