Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ogicse!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.sys.ibm.pc Subject: Re: swapd vs. cd - Message-ID: <7441@tekgvs.LABS.TEK.COM> Date: 3 May 90 15:13:07 GMT References: <1990Apr5.202951.6031@cimcor.mn.org> <19450017@hpfinote.HP.COM> <7363@tekgvs.LABS.TEK.COM> <6426@star.cs.vu.nl> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 16 In article <6426@star.cs.vu.nl> msschaa@cs.vu.nl (Schaap MS) writes: >In 4DOS say: >alias swapd=`set d1=%_cwd^popd^set d2=%_cwd^cd %d1^pushd %d2^unset d1 d2` Darn! It's so obvious :-). I would suggest using "cdd" instead of "cd" since pushd/popd will change drives, too. Another possibility, which is more csh-like is to allow for "pushd", no arguments, to swap: alias pushd=`iff "%1"=="" then^set d1=%_cwd^popd^set d2=%_cwd^cd %d1^*pushd %d2^unset d1 d2^else^*pushd %1^endiff` I haven't tried this yet, but it should work. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply