I've been experimenting with
popd in bash (Cygwin, man page says "GNU bash 4.1") and the man page doesn't quite seem to match the behavior.
pushd, the command
% pushd +1
both rotates the stack and changes the working directory;
% pushd -n +1
just rotates the stack. This seems to match the man page.
% popd +1
removes an entry from the stack but does NOT change the working directory (even though "-n" was not supplied). This does not seem to match the man page, quoted below:
Arguments, if supplied, have the following meanings:
-n Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated.
+n Removes the nth entry counting from the left of the list shown by
dirs, starting with zero. For example: “
popd +0” removes the first directory, “
popd +1” the second.
Is this the way it is supposed to be?