Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zmv -W/-w in subdirs, possibly patch
- X-seq: zsh-workers 27249
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: zmv -W/-w in subdirs, possibly patch
- Date: Sun, 6 Sep 2009 23:29:33 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DUcK1IrKEvUWNT9U480ohdPn26Z4smTyYvNaDvSZZ78=; b=c6PzZElUvo0pazoEuhwyQlSAu4KuN7BHizUIN823nCFXukPnYpgdi63sHBf55oMgy3 Zvc/M3Hc9xqgRREpTxHh+4ELGWAUqAJOO1NFZZScO6rIpJcGfDVYA6KPBl8wlmxl6jXm FHfM8MzWNv5Kg8+xCps/WeEe7yGq3sTeMw0ak=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Tw//YpD433+Ux6w5plym1ImDxt+/2vq5OpzufP5GMB++uDvOAr8onMHJjapPrtkd8w nQd2gf+wsNnASARj4JU9ReSxlDFB+5Z+zb4IVtsKU+mnPxFLHAPJPO5p1RVKCQ/7ztQH ZRx3Kz9gT5Vcr7X4dqpp2Gcdqkt33BHE/1Rhg=
- In-reply-to: <20090906194821.73936211@pws-pc>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0909051629x73f79a43v49d9baa573c5b19@xxxxxxxxxxxxxx> <20090906194821.73936211@pws-pc>
2009/9/6 Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>:
> On Sun, 6 Sep 2009 01:29:50 +0200
> Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> My question is: Why was the / there in the first place? Would the
>> above patch break any existing usecases?
>> (in case it is hard to spot, the patch removes the only / on the
>> line). If it does break some weird complex
>> pattern, maybe I would argue that you should not use -w then.
>
> I've a suspicion this was supposed to catch **/. This might even work.
>
> Index: Functions/Misc/zmv
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Functions/Misc/zmv,v
> retrieving revision 1.14
> diff -u -r1.14 zmv
> --- Functions/Misc/zmv 11 May 2008 11:23:31 -0000 1.14
> +++ Functions/Misc/zmv 6 Sep 2009 18:44:18 -0000
> @@ -187,7 +187,7 @@
> # Well, this seems to work.
> # The tricky bit is getting all forms of [...] correct, but as long
> # as we require inactive bits to be backslashed its not so bad.
> - find='(#m)((\*\*#/|[*?]|<[0-9]#-[0-9]#>|\[(^|)(\]|)(\[:[a-z]##:\]|\\?|[^\]])##\])\##|?\###)'
> + find='(#m)((\*\*##/|[*?]|<[0-9]#-[0-9]#>|\[(^|)(\]|)(\[:[a-z]##:\]|\\?|[^\]])##\])\##|?\###)'
> tmp="${pat//${~find}/$[++cnt]}"
> if [[ $cnt = 0 ]]; then
> print -r -- "$myname: warning: no wildcards were found in search pattern" >&2
Your version works with *.foo, */*.foo and **/*.foo, I didn't try any
other variations.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author