> /tmp > $ echo "$PS1" > \w\n\$ > /tmp > $ mkdir -p ZZ/a/b/c > /tmp > $ pushd ZZ > /tmp/ZZ /tmp > /tmp/ZZ > $ pushd a > /tmp/ZZ/a /tmp/ZZ /tmp > /tmp/ZZ/a > $ pushd b/c > /tmp/ZZ/a/b/c /tmp/ZZ/a /tmp/ZZ /tmp > /tmp/ZZ/a/b/c > $ popd /var/tmp > /tmp/ZZ/a/b/c /tmp/ZZ/a /tmp/ZZ > /tmp/ZZ/a/b/c > $ popd /var/tmp > /tmp/ZZ/a/b/c /tmp/ZZ/a > /tmp/ZZ/a/b/c > $
It is behaving as if it were seeing the "-0" option. But it really isn't the -0 option. The `-N' option probably should mention (just for clarity) that the directory is left unchanged, just as with '-n'. `popd' 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'; i.e., `popd' is equivalent to `popd +0'. `+N' Removes the Nth directory (counting from the left of the list printed by `dirs'), starting with zero. `-N' Removes the Nth directory (counting from the right of the list printed by `dirs'), starting with zero. `-n' Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated.