Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!decwrl!decvax!watmath!sahayman From: sahayman@watmath.waterloo.edu (Steve Hayman) Newsgroups: comp.unix.wizards Subject: Re: Using the directory stack like !-2:3 in csh Message-ID: <18952@watmath.waterloo.edu> Date: 18 May 88 07:44:55 GMT References: <115@lakart.UUCP> Reply-To: sahayman@watmath.waterloo.edu (Steve Hayman) Organization: Math Faculty Computing Facility, U. of Waterloo Lines: 24 In article <115@lakart.UUCP> dg@lakart.UUCP (David Goodenough) asks about a way to refer to the entries on csh's directory stack. I have this in my .cshrc, I'm sure there are other ways but this is pretty simple. This lets me use $1, $2 and so on to refer to the directory stack entries. if ( ! $?prompt ) goto skipprompt ... various other things for interactive shells only ... alias cd 'cd \!*; setdirs' alias pushd 'pushd \!*; setdirs' alias popd 'popd \!*; setdirs' alias setdirs 'set argv=(`dirs`)' skipprompt: Hope this is of some use to somebody. Steve Hayman Math Faculty Computing Facility University of Waterloo watmath!sahayman sahayman@math.waterloo.edu sahayman@water.bitnet