Path: utzoo!attcan!uunet!littlei!ogcvax!schaefer From: schaefer@ogcvax.ogc.edu (Barton E. Schaefer) Newsgroups: comp.unix.wizards Subject: Re: How to clear directory stack in csh Message-ID: <1688@ogcvax.ogc.edu> Date: 17 May 88 17:15:45 GMT References: Reply-To: schaefer@ogcvax.UUCP (Barton E. Schaefer) Organization: Oregon Graduate Center, Beaverton, OR Lines: 39 Posted: Tue May 17 10:15:45 1988 In article roy@phri.UUCP (Roy Smith) writes: } } Is there any way to clear the directory stack in csh without doing popd? No, but there's a way to do popd without causing the csh to change to the directory being popped. } The problem was that my directory stack was "/ /mnt/etc". I was } allowed to umount /mnt because while /mnt/etc was in my dirstack because it } wasn't actually the current directory of any proces, but I couldn't clear } the dirstack because a popd would try to cd back to /mnt/etc which no } longer existed. To remove a bogus directory from the stack, use popd +N where N is the stack position of the bogus directory. Position 0 (zero) is the top of the stack. In the example above, % dirs / /mnt/etc % popd +1 / % For those interested, pushd can also take a +N argument, which rotates the directory stack N positions. } Roy Smith, System Administrator } Public Health Research Institute } 455 First Avenue, New York, NY 10016 } {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net -- Bart Schaefer CSNET schaefer@cse.ogc.edu UUCP ...{tektronix,verdix}!ogcvax!schaefer Hobbes: "How come we play war and not peace?" Calvin: "Too few role models."