How to clear directory stack in csh

Mark Davies mark at comp.vuw.ac.nz
Tue May 17 11:14:15 AEST 1988


In article <3269 at phri.UUCP> roy at phri.UUCP (Roy Smith) writes:
>                                     ..., but I couldn't clear
>the dirstack because a popd would try to cd back to /mnt/etc which no
>longer existed.  Having a bogus directory at the bottom of my dirstack
>doesn't actually do any harm, but it was annoying that I couldn't find any
>way to get rid of it without exiting the shell.

popd +1 will remove the first entry in the directory stack (given current
directory is the 0th entry) so if you have a stack that was
	"/ /mnt/etc"
popd +1 will leave it as "/" and since this does not involve changing
directory it doesn't matter that /mnt/etc no longer exists. (This works on
all machines I have access to, Pyramid, Sun, 4.3BSD Vaxen).

mark
-- 
Domainised:  mark at comp.vuw.ac.nz	Bang form: ...!uunet!vuwcomp!mark



More information about the Comp.unix.wizards mailing list