Short: V37 dir stack cmds like in Unix tcsh Type: util/cli Uploader: torsten@diku.dk (Torsten Poulin Nielsen) Author: torsten@diku.dk (Torsten Poulin Nielsen) PushD(V37) PushD(V37) FORMAT PushD [[DIR] name | TOP number] PopD [[DISCARD] number] Dirs [NUM] TEMPLATES DIR,TOP/K/N DISCARD/N NUM/S PURPOSE To maintain and manipulate a stack of directories. SPECIFICATION PushD with no arguments, swaps the top two elements of the directory stack. Given a name argument, PushD changes to the new directory and pushes the old current working directory onto the directory stack. If the TOP argument is given, PushD extracts the numberth argument of the directory stack and makes it the current directory. The members of the directory stack are numbered from the top, starting with 0 which is the current directory. PushD top 1 has the same effect as PushD without arguments. DIR and TOP are mutually exclusive. PopD pops the directory stack, returning to the new top directory. With a numerical argument, it discards the numberth entry in the stack. This is useful for removing directories from the stack that don't exist anymore. Giv­ ing the argument 0 has the same effect as PopD without an argument, i.e., stack element 1 becomes the new current directory. Dirs prints the directory stack; the top of the stack is at the left; the first directory in the stack is the cur­ rent directory. If the NUM switch is used, each directory is printed on a line by itself, preceded by its number in the stack. The current directory is given the number 0. The contents of the directory stack is kept in the shell variable DStack. An easy way of discarding the entire stack is therefore to say 1> Unset DStack It shouldn't be too difficult to come up with a way in which to save the contents of the stack between sessions. INSTALLATION There is only one executable, PushD. The other two are just links: 1> MakeLink PopD PushD 1> MakeLink Dirs PushD CAVEAT If used under WShell, the prompt string isn't updated as it should after a directory change. This is an anomaly in WShell. As a kludge, you can put %[cd >nil:] in your prompt string. This forces WShell to update its idea of the current directory after each command. AUTHOR Torsten Poulin (torsten@diku.dk) UNRESTRICTIONS PushD is free; anyone may redistribute copies of PushD to anyone under the terms stated in the GNU General Public Licence, a copy of which accompanies each copy of PushD. Torsten Poulin encourages you to improve and extend PushD and urges that you contribute your extensions to the world. SEE ALSO CD(AmigaDOS) .