Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ^foo^bar question
- X-seq: zsh-users 9973
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
- To: Zsh User <zsh-users@xxxxxxxxxx>, f.borges@xxxxxx
- Subject: Re: ^foo^bar question
- Date: Wed, 1 Mar 2006 11:17:14 -0500
- In-reply-to: <20060301160218.GA26591@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060301160218.GA26591@xxxxxxxxxx>
Francisco Borges sent me the following 0.7K:
> Hello!
>
> I recently started using the ^foo^bar trick a lot. However I discovered
> that if I use:
>
> % mv ../2500s_4p_3ftr.txt 4p
> % ^4^8
> % mv ../2500s_8p_3ftr.txt 4p # second "4" is unchanged.
> ^^^^
> where only the first string occurence gets replaced. This happens with
> 4.2.5, 4.3.0-dev-1 and 4.3.1. Is this the intended behavior?
>
> Is there any way to get multiple substitutions using ^foo^bar?
This just came up a few months ago on this list, 'cuz I was wondering
the same thing. You can check the archives for the whole discussion.
Peter was working on some things to allow multiple substitutions with
that syntax, but I was also informed of this trick:
% mv ../2500s_4p_3ftr.txt 4p
% r 4=8
--
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author