🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1627

Re: Csh question: Doing cd .. from a symbolically linked directory

#1627
From: Maarten Litmaath
Date: Fri, 26 Oct 1990 19:09
16 lines
1270 bytes
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
Technical Details
Message-ID: <8060@star.cs.vu.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!maart
References: <JERRY.90Oct24110101@sky.slhisc.uucp> <KIVINEN.90Oct25125016@deathstar.hut.fi> <8049@star.cs.vu.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <JERRY.90Oct24110101@sky.slhisc.uucp> <KIVINEN.90Oct25125016@deathstar.hut.fi> <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