Using the directory stack like !-2:3 in csh

David Goodenough dg at lakart.UUCP
Fri May 27 00:03:02 AEST 1988


Being as I started this mess, I think it only fair to tell the most elegant
solution I got:

alias	cd	'cd \!* ; sds'
alias	popd	'popd \!* ; sds'
alias	pushd	'pushd \!* ; sds'
alias	sds	'set argv=(`dirs`)'

This works because in an interactive csh argv is idle. So when I set argv
to be ( ` dirs ` ), $1 == $cwd, $2 == second dir, etc.

Absolutely brilliant. Apologies to whoever suggested this, I've forgotton
your name. I still think this is simple, elegant, and it has made my life
SO MUCH easier.
-- 
	dg at lakart.UUCP - David Goodenough		+---+
							| +-+-+
	....... !harvard!adelie!cfisun!lakart!dg	+-+-+ |
						  	  +---+



More information about the Comp.unix.wizards mailing list