This question is related to pushd and popd. After I have pushed directories, I would like to see what are the contents of the stack currently before I execut e popd. The reason is that many a times we forget (or can get confused when multiple shells are open) what we pushed and would like to first check that we get what we expect when we pop.
Regards
from UNIX Power Tools (chapter 14: Moving Around in a Hurry):
The dirs command prints the directory stack. It's a good way to find out where you are.
Some people like to put the dirs command in their prompt (7.11), but I personally find
incredibly long prompts more annoying than helpful.
Thanks a lot ..
BTW, when you say putting dirs in the prompt, did you mean `pwd` ?
because dirs will list all the stack contents
Regards
`pwd` is different than prompt. `pwd` tells you the present working directory.
To know what is your primary prompt, type:
echo $PS1
To know what is your secondary prompt, type:
echo $PS2
My reply was in response to your remark
"Some people like to put the dirs command in their prompt"
I assumed that you set your prompt to display result of command "dirs".
You probably meant directory above (using something like set $prompt = $cwd ..") and not dirs command itself