From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19264 invoked from network); 13 Apr 1999 20:37:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Apr 1999 20:37:54 -0000 Received: (qmail 27412 invoked by alias); 13 Apr 1999 20:37:09 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2300 Received: (qmail 27394 invoked from network); 13 Apr 1999 20:37:08 -0000 Date: Tue, 13 Apr 1999 15:32:20 -0500 From: "Larry P. Schrof" To: zsh-users@sunsite.auc.dk Subject: Second form of cd. Message-ID: <19990413153219.A20809@lyric.cig.mot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i I am wondering if this an intentional feature or a bug. I am running 3.1.5... When you type 'cd ' on the command line, zsh replaces only the FIRST occurance of in the directory. I've actually run into situations where occurs more than once in $PWD, and I'd like to replace this second occurance of old. I am requesting that replace ALL occurances of in $PWD, not just the first one. Thanks. - Larry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19542 invoked from network); 13 Apr 1999 21:08:10 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Apr 1999 21:08:10 -0000 Received: (qmail 1056 invoked by alias); 13 Apr 1999 21:07:48 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2301 Received: (qmail 1049 invoked from network); 13 Apr 1999 21:07:47 -0000 Date: Tue, 13 Apr 1999 17:07:38 -0400 From: Sweth Chandramouli To: zsh-users@sunsite.auc.dk Subject: Re: Second form of cd. Message-ID: <19990413170738.A9872@astaroth.nit.gwu.edu> Mail-Followup-To: zsh-users@sunsite.auc.dk References: <19990413153219.A20809@lyric.cig.mot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <19990413153219.A20809@lyric.cig.mot.com> On Tue, Apr 13, 1999 at 03:32:20PM -0500, Larry P. Schrof wrote: > I am wondering if this an intentional feature or a bug. I am running > 3.1.5... > > When you type 'cd ' on the command line, zsh replaces > only the FIRST occurance of in the directory. I've actually run > into situations where occurs more than once in $PWD, and I'd > like to replace this second occurance of old. > > I am requesting that replace ALL occurances of in $PWD, not > just the first one. along the same lines, the ^old^new form of history substitution replaces just the first instance of old. perhaps a flag of some sort (cd -g, maybe, for cd, and ^^old^new for history substitution?) could be added to indicate that global replacement should occur? -- sweth. -- Sweth Chandramouli IS Coordinator, The George Washington University / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) * From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29804 invoked from network); 14 Apr 1999 16:03:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Apr 1999 16:03:05 -0000 Received: (qmail 29909 invoked by alias); 14 Apr 1999 16:02:37 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2305 Received: (qmail 29901 invoked from network); 14 Apr 1999 16:02:35 -0000 From: "Bart Schaefer" Message-Id: <990414090225.ZM1967@candle.brasslantern.com> Date: Wed, 14 Apr 1999 09:02:25 -0700 In-Reply-To: <19990413153219.A20809@lyric.cig.mot.com> Comments: In reply to "Larry P. Schrof" "Second form of cd." (Apr 13, 3:32pm) References: <19990413153219.A20809@lyric.cig.mot.com> <19990413170738.A9872@astaroth.nit.gwu.edu> In-Reply-To: <19990413170738.A9872@astaroth.nit.gwu.edu> Comments: In reply to Sweth Chandramouli "Re: Second form of cd." (Apr 13, 5:07pm) X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-users@sunsite.auc.dk Subject: Re: Second form of cd. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 13, 3:32pm, Larry P. Schrof wrote: } Subject: Second form of cd. } } I am wondering if this an intentional feature or a bug. I am running } 3.1.5... It's the intended behavior. Interpret that as you will. } When you type 'cd ' on the command line, zsh replaces } only the FIRST occurance of in the directory. I've actually run } into situations where occurs more than once in $PWD, and I'd } like to replace this second occurance of old. The way I usually deal with this is to disambiguate the replacement string somehow. E.g. suppose the two directories are ~/src/package/src/subdir/ ~/src/package/build/subdir/ "cd src build" attempts to change to ~/build/package/src/subdir/, which doesn't exist. So instead I type something like cd src/s build/s to force the match on the correct substring. } I am requesting that replace ALL occurances of in $PWD, not } just the first one. That would, in many cases, be equally wrong. The best solution for this is cd $PWD:gs/new/old On Apr 13, 5:07pm, Sweth Chandramouli wrote: } Subject: Re: Second form of cd. } } along the same lines, the ^old^new form of history substitution } replaces just the first instance of old. perhaps a flag of some sort } (cd -g, maybe, for cd, and ^^old^new for history substitution?) could be } added to indicate that global replacement should occur? What's wrong with !!:gs/old/new ? Horrors, four whole extra characters? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com