Path: utzoo!mnetor!uunet!munnari!mulga!ausmelb!ejp From: ejp@ausmelb.oz.au (Esmond Pitt) Newsgroups: comp.sources.d Subject: Re: idea for tcsh Message-ID: <512@ausmelb.oz.au> Date: 9 Dec 87 01:30:14 GMT References: <147@csvaxa.UUCP> Reply-To: ejp@ausmelb.oz.au (Esmond Pitt) Organization: Austec International Limited, Melbourne Lines: 28 In article <147@csvaxa.UUCP> edward@csvaxa.UUCP (Edward Wilkinson) writes: > I've often wanted to save > my directory stack between sessions, as currently done with the > history list. Has anyone made any hacks to allow this? You can do this outside, from .login and .logout. Regardez: .logout: # save dir stack - if we can! if ( -w $HOME ) then dirs > $HOME/.dirs endif .login: # get dirs foreach d (`cat ${HOME}/.dirs`) pushd $d >& /dev/null pushd +1 >& /dev/null # swap to bottom of stack end unset d # Clean, ain't I? popd # pop ~ to get to last wd, and display stack set argv=(`dirs`) # store dir stack, to access as $[0-9] -- Esmond Pitt, Austec International Ltd ...!seismo!munnari!ausmelb!ejp,ejp@ausmelb.oz.au