Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.shell Subject: Re: Csh question: Doing cd .. from a symbolically linked directory Message-ID: <8060@star.cs.vu.nl> Date: 26 Oct 90 19:09:31 GMT References: <8049@star.cs.vu.nl> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Distribution: comp.unix.shell Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 16 Here's a slight improvement; check the output of `cd /'; furthermore you won't get into trouble if you accidentally type `cd foo/ bar' or if there is a subdirectory `0' and you type `cd0'. --------------------cut here-------------------- alias cd 'set tmp=(\!*); eval _cd_$#tmp $cwd \!*//. ../ ~; echo $cwd' alias _cd_0 'chdir \!$' alias _cd_1 'if (x\!:2 !~ x../*) set status=1'\ '&& eval _cd_x /\!^:h \!:2-:s-../--'\ '|| chdir \!:2:h' alias _cd_x 'if (x\!:2 !~ x../*) set status=1'\ '&& eval _cd_x /\!^:h \!:2*:s-../--'\ '|| chdir \!^/\!:2:h' alias pwd 'echo $cwd' --------------------cut here-------------------- -- Waiting for this to work: cat /internet/cs.vu.nl/finger/maart