zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>, jarausch@igpm.rwth-aachen.de
Subject: Re: breadth first globbing
Date: Tue, 31 Mar 2015 14:10:09 +0200	[thread overview]
Message-ID: <CAHYJk3SUc2dJv7RRDPhJZA1DV8pLAPkOoDhnCMfs-et63KRQEQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7a21cqth0=5JekdZokUkE7P45HgVVCi6=FX+2XAK03bQg@mail.gmail.com>

On Tue, Mar 31, 2015 at 12:42 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
>
> On Mar 31, 2015 3:05 AM, "Mikael Magnusson" <mikachu@gmail.com> wrote:
>>
>> On Tue, Mar 31, 2015 at 11:44 AM, Helmut Jarausch
>> <jarausch@igpm.rwth-aachen.de> wrote:
>> >
>> > I have (unpacked) a directory tree where directories don't have the
>> > executable bit.
>> >
>> > Standard globbing like  **/*(/) doesn't work because zsh tries to cd to
>> > the directories
>> > before I can chmod +x these.
>> >
>>
>> I would probably just chmod -R +x followed by chmod -x **/*(.)
>
> Breadth-first globbing is **/*(/Od)
> but in this case the problem is that globbing itself can't match anything
> until the directory modes have changed, I think?
>
> So I'd just do something like
>
> while chmod +x **/*(/^x); do :; done
>
> Assuming you have nomatch set so the loop will fail when all directories
> have the x mode.

Another possibility is
: **/*(/e:chmod +x \$REPLY:)
But it will run very slowly if there are a large number of directories
(one fork per directory).

-- 
Mikael Magnusson


  reply	other threads:[~2015-03-31 12:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  9:44 Helmut Jarausch
2015-03-31 10:04 ` Mikael Magnusson
2015-03-31 10:42   ` Bart Schaefer
2015-03-31 12:10     ` Mikael Magnusson [this message]
2015-03-31 10:53   ` Michal Politowski
  -- strict thread matches above, loose matches on Subject: below --
2015-03-31  9:32 Helmut Jarausch

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=CAHYJk3SUc2dJv7RRDPhJZA1DV8pLAPkOoDhnCMfs-et63KRQEQ@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=jarausch@igpm.rwth-aachen.de \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).