Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!sri-spam!ames!oliveb!pyramid!prls!philabs!ttidca!sa From: sa@ttidca.TTI.COM (Steve Alter) Newsgroups: comp.sources.d Subject: Re: idea for tcsh Message-ID: <1511@ttidca.TTI.COM> Date: Mon, 7-Dec-87 03:41:24 EST Article-I.D.: ttidca.1511 Posted: Mon Dec 7 03:41:24 1987 Date-Received: Sun, 13-Dec-87 15:23:42 EST References: <147@csvaxa.UUCP> <6797@brl-smoke.ARPA> Organization: Citicorp/TTI, Santa Monica Lines: 35 In article <6797@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) writes: >In article <147@csvaxa.UUCP> edward@csvaxa.UUCP (Edward Wilkinson) writes: >> ... [In tcsh] 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? > > ... The way I would do this >would be to make my .logout file create a "dot file" in my home >directory containing the directory stack (which at least in my >Bourne shell environment is just the value of an environment >variable kept up to date by "cd", "pushd", etc.). Then my .profile >(or perhaps my .shrc per-shell startup file) would, if this dot file >were present, use it to initialize the environment variable. How about this: In .logout: dirs > ~/.stack In .login: if ( -r ~/.stack ) then foreach d ( `cat ~/.stack` ) pushd $d > /dev/null pushd +1 > /dev/null end popd > /dev/null endif echo -n "Directories: " ; dirs It works; I just finished testing it. Note that this is NOT specific to tcsh; it should work in almost any implementation of the c-shell because this is all standard stuff. -- Steve Alter ...!{csun,rdlvax,trwrb,psivax}!ttidca!alter or alter@tti.com Citicorp/TTI, Santa Monica CA (213) 452-9191 x2541