Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: -W option for zmv (updated)
- X-seq: zsh-workers 16927
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: -W option for zmv (updated)
- Date: Thu, 28 Mar 2002 18:38:05 -0800
- In-reply-to: <Pine.LNX.4.33L2.0203281524340.16964-100000@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.4.33L2.0203281524340.16964-100000@xxxxxxxxxxxxxxx>
On Mar 28, 5:12pm, Wayne Davison wrote:
> > x=(x x x x x x)
> > print ${(e)x//x/\$[++N]}
>
> Thanks! That's the nudge I needed to make things more efficient.
>
> + find='(#m)(\*\*#[/]|[*?]|\<[0-9]#-[0-9]#\>|\[(\[:[a-z]##:\]|\\\[|\\\]|[^\[\]]##)##\])\##'
> + tmp="${pat//${~find}/$[++cnt]}"
and later
> + integer N=0
> + repl="${repl//${~find}/$open$[++N]$close}"
That doesn't work for me:
schaefer[501] find=x open=\$\{ close=\}
schaefer[502] repl=xxxxxx
schaefer[503] N=0
schaefer[504] repl="${repl//${~find}/$open$[++N]$close}"
schaefer[505] echo $repl
${1}${1}${1}${1}${1}${1}
It should be
repl="${(e)repl//${~find}/\$open\$[++N]\$close}"
Are you sure you sent the correct version of the patch?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author