Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: breadth first globbing
- X-seq: zsh-users 20057
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: breadth first globbing
- Date: Tue, 31 Mar 2015 14:10:09 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>, jarausch@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CTZlSeVDHH4rbPPl5PcxGQjovFT2TJXIkBJDCHDXP3g=; b=v/jZVDFcZWN0n3FYnxyv9v0qcQmjltE9X2s2eYuswdi7l3hwOZpE/L4fgxBtXt1oDO r5iep3WylSpUwAIcwfAog7os/WL2Tmxv74mO4f4ddzofpbrZ+cebNfMrn871CTkzKpjm rytBTTphYeaxIk1IdzRE7XnSLr6NgOLmQO6lL563p3U+www5bc77TZ8FY4UM8TYAHB5t ahnHt12J0P38Jk1PMUIx4HfJ/ASC8xjeTiwtA7aKOub/pcgVLK+pUKNBS/I8B5UOxxbv 7q+yJMxoS3zDE2RULQ0NemHOQTSQU7yI07XPIASJf2U+zKi1OA5mH9M+YQOOu22LOK79 zH2w==
- In-reply-to: <CAH+w=7a21cqth0=5JekdZokUkE7P45HgVVCi6=FX+2XAK03bQg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <tYlYiviWgd+7s75YNyNGDs@44xonsNjwD3MgaJWGxYjI> <CAHYJk3RitGhSJF_k0UwZH5TGXGWiMFCxn--F2-JpxDL3M4Akkw@mail.gmail.com> <CAH+w=7a21cqth0=5JekdZokUkE7P45HgVVCi6=FX+2XAK03bQg@mail.gmail.com>
On Tue, Mar 31, 2015 at 12:42 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Mar 31, 2015 3:05 AM, "Mikael Magnusson" <mikachu@xxxxxxxxx> wrote:
>>
>> On Tue, Mar 31, 2015 at 11:44 AM, Helmut Jarausch
>> <jarausch@xxxxxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author