Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ^foo^bar question



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