From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4462 invoked by alias); 31 Mar 2015 12:10:24 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20057 Received: (qmail 21875 invoked from network); 31 Mar 2015 12:10:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== MIME-Version: 1.0 X-Received: by 10.42.111.68 with SMTP id t4mr66452920icp.36.1427803809985; Tue, 31 Mar 2015 05:10:09 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 Mar 2015 14:10:09 +0200 Message-ID: Subject: Re: breadth first globbing From: Mikael Magnusson To: Bart Schaefer Cc: Zsh Users , jarausch@igpm.rwth-aachen.de Content-Type: text/plain; charset=UTF-8 On Tue, Mar 31, 2015 at 12:42 PM, Bart Schaefer wrote: > > On Mar 31, 2015 3:05 AM, "Mikael Magnusson" wrote: >> >> On Tue, Mar 31, 2015 at 11:44 AM, Helmut Jarausch >> 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