zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: zmv -W/-w in subdirs, possibly patch
Date: Sun, 6 Sep 2009 23:29:33 +0200	[thread overview]
Message-ID: <237967ef0909061429q4f2c3bc1r4d67d0b522a7543b@mail.gmail.com> (raw)
In-Reply-To: <20090906194821.73936211@pws-pc>

2009/9/6 Peter Stephenson <p.w.stephenson@ntlworld.com>:
> On Sun, 6 Sep 2009 01:29:50 +0200
> Mikael Magnusson <mikachu@gmail.com> 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


      reply	other threads:[~2009-09-06 21:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-05 23:29 Mikael Magnusson
2009-09-06 18:48 ` Peter Stephenson
2009-09-06 21:29   ` Mikael Magnusson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=237967ef0909061429q4f2c3bc1r4d67d0b522a7543b@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).