Path: utzoo!yunexus!geac!steve From: steve@geac.UUCP (Steve Lane) Newsgroups: comp.unix.wizards Subject: Re: Using the directory stack like !-2:3 in csh Message-ID: <2772@geac.UUCP> Date: 24 May 88 13:11:15 GMT Article-I.D.: geac.2772 Posted: Tue May 24 09:11:15 1988 References: <115@lakart.UUCP> Reply-To: steve@geac.UUCP (Steve Lane) Organization: Geac Computers International Inc. Lines: 33 In article <115@lakart.UUCP> dg@lakart.UUCP (David Goodenough) writes: > >but what I really want to do is to be able to say: > > @:3/tcp.ip.h > >where @:3 gets the third entry on my directory stack. > >Can I do this?? >-- > dg@lakart.UUCP - David Goodenough +---+ > | +-+-+ > ....... !harvard!adelie!cfisun!lakart!dg +-+-+ | > +---+ You can use the 'dirs' command, and alias the usual directory commands in the following manner: - include the following shell variable initialization in your .login set d=$HOME - and add three lines to your .cshrc alias cd 'cd \!*;set d=`dirs`' alias pushd 'pushd \!*; set d=`dirs`' alias popd 'popd; set d=`dirs`' In that way, your directory stack is always saved in $d[1], $d[2], ... with $d[1] being your current working directory. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Steve Lane, UUCP: ...[mnetor, yunexus, utgpu]!geac!steve Geac Computers International Inc. Markham, Ontario. (416) 475-0525