[Top][All Lists]

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

Subject: Manual directory stack ambiguity

From: Tim Nielens
Subject: Subject: Manual directory stack ambiguity
Date: Fri, 14 Aug 2015 12:08:07 +0200

Machine: x86_64
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='x86_64-unknown-cygwin' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS   -I.  -I/usr/src/bash-4.3.39-2.x86_64/src/bash-4.3 -I/usr/src/bash-4.3.39-2.x86_64/src/bash-4.3/include -I/usr/src/bash-4.3.39-2.x86_64/src/bash-4.3/lib  -DWORDEXP_OPTION -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/bash-4.3.39-2.x86_64/build=/usr/src/debug/bash-4.3.39-2 -fdebug-prefix-map=/usr/src/bash-4.3.39-2.x86_64/src/bash-4.3=/usr/src/debug/bash-4.3.39-2
uname output: CYGWIN_NT-6.1 DIENB090 2.1.0(0.287/5/3) 2015-07-14 21:28 x86_64 Cygwin
Machine Type: x86_64-unknown-cygwin

Bash Version: 4.3
Patch Level: 39
Release Status: release

There is a ambiguity about the directory stack in the manual: 6.8.1 Directory Stack Builtins

It's difficult to understand if the current directory is part of the stack or not.

For example :
 - description of the popd builtin :
 "          popd [-n] [+N | -N]

     Remove the top entry from the directory stack, and 'cd' to the
     new top directory.  When no arguments are given, 'popd' removes
     the top directory from the stack and performs a 'cd' to the new
     top directory.  The elements are numbered from 0 starting at the
     first directory listed with 'dirs'; that is, 'popd' is equivalent
     to 'popd +0'. 
     By this description, one can understand that the
     current dir is the top directory, that it is removed and the new
     top directory is then used as current directory

 - description of the pushd builin:
 "           pushd [-n] [+N | -N | DIR]

     Save the current directory on the top of the directory stack and
     then 'cd' to DIR.  With no arguments, 'pushd' exchanges the top
     two directories. 
     By this one can understand that DIR will not
     be pushed on the stack. So after the operation, the current dir
     is not the first stacked directory. It also doesn't specify that the pushd
     operation wihtout argument will changes the current directory. It
     says that it swaps the top two directories. Again, not clear if
     it's talking about the current dir and the first stacked dir or
     the two first stacked dir.
Within the whole manual node, it's never clear whether the directory stack includes the current directory or not.

Read the manual...

reply via email to

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