From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from po5.andrew.cmu.edu ([128.2.10.105]) by archone.tamu.edu with SMTP id <19071>; Tue, 1 Oct 1991 09:36:38 -0500 Received: by po5.andrew.cmu.edu (5.54/3.15) id for rc@archone.tamu.edu; Tue, 1 Oct 91 10:36:20 EDT Received: via switchmail; Tue, 1 Oct 1991 10:36:20 -0400 (EDT) Received: from borman.res.andrew.cmu.edu via qmail ID ; Tue, 1 Oct 1991 10:36:10 -0400 (EDT) Received: from borman.res.andrew.cmu.edu via qmail ID ; Tue, 1 Oct 1991 10:36:04 -0400 (EDT) Received: from BatMail.robin.v2.12.CUILIB.3.45.SNAP.NOT.LINKED.borman.res.andrew.cmu.edu.pmax.ul4 via MS.5.6.borman.res.andrew.cmu.edu.pmax_ul4; Tue, 1 Oct 1991 10:36:03 -0400 (EDT) Message-Id: Date: Tue, 1 Oct 1991 09:36:03 -0500 From: "Paul D. Swasey" To: rc@archone.tamu.edu Subject: interactive cd In-Reply-To: <91Sep30.110621cdt.19044@archone.tamu.edu> References: <91Sep30.110621cdt.19044@archone.tamu.edu> After using Bash then ksh for such a while, I find myself missing the symbolic link following done by those shells... So I wrote a version of cd that maintained it's own version of the working directory and handled cd .. by hacking that version the cd'ing to the result (talking about rc functions, not C). After a little use, I realized I had forgotten about cdpath. I am now stuck. I wanted to give the same interface as builtin cd and was counting on it to loop through cdpath for me (a hi-level loop here is *slow*) ... I was using something like dir = `{builtin cd $1} ...thinking dir would be () if $1 was in the current directory or dir would be the new absolute path of $cwd (the variable holding the working directory). Of course, `{ } invokes a non-interactive subshell and builtin cd doesn't print the directory if cdpath is used...oops My question is do you think it's "right" to add a my_chdir() to rc that deals with .. `correctly'? (It would only be a run-time option, of course). My original intent was to make a function to use interactivley ... not touching the correct semantics of cd. Now that I've started writing my_chdir, I'd like to know if anything like it will ever be in the official rc, given that such a "feature" is a possible source of confusion: ; ENV=() ksh Switching to new tty driver... $ cd ; ls Emacs OldFiles docs lib src u Mailbox bin include man tmp $ cd bin; /bin/pwd /afs/andrew.cmu.edu/usr16/ps3u/.depot/pmax_ul4/bin $ more ../tmp/* ../tmp/: No such file or directory $ ls ~/tmp bash forth netrek_scoutiness nt_servers unix client guest_list nt_clients to_handle $ Is anyone interested in the function or (when I finish it -- not today, I'm tired) the code? -dave ps3u+@andrew.cmu.edu R746PS3U@VB.CC.CMU.EDU