From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24137 invoked by alias); 28 Oct 2015 21:15:38 -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: 20848 Received: (qmail 21928 invoked from network); 28 Oct 2015 21:15:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=xjfp8O4kZkk6+BGnUad1+2zdTFtyca3oysxYpHh4mlg=; b=uryFBk02RVbvwGGsi7/U1Hlh5Rsk0Ma8wzn4N+9s+32nxiyOnNlQV7N8RbYrEq6isZ BdKVGU+gXqydgq9DmUhi0B6dLzM9u5oBG0ywdl4kehGpf8mHpb592hHKk+r0RGGe6IwV B+Pc1UXNLLW7sB80FIOXIvoTRjGMUVvpRotXmJEJYdGMVmeQR3x4er1kY/utnuPPtSA2 m6kF2pJgBh7juO9giYD13QinPj8/qp5mH1IneW+WeaDRMe7dEvIMCUMsDqOwNNeVRfCO bxd89TYSgsk1qzAaBX663JxNV6XupeII/g5o/jph+ZbwzNXu81jfpzTLynYXx82AqyQH sZ2A== X-Received: by 10.194.23.228 with SMTP id p4mr12729984wjf.151.1446066933623; Wed, 28 Oct 2015 14:15:33 -0700 (PDT) Date: Wed, 28 Oct 2015 21:15:32 +0000 From: Stephane Chazelas To: ZyX Cc: Mikael Magnusson , "vogt@linux.vnet.ibm.com" , Zsh Users Subject: Re: Recursive globbing shorthand (a la **.c) Message-ID: <20151028211532.GA16113@chaz.gmail.com> Mail-Followup-To: ZyX , Mikael Magnusson , "vogt@linux.vnet.ibm.com" , Zsh Users References: <20151028065702.GA8236@linux.vnet.ibm.com> <240121446059044__35603.2418822453$1446059490$gmane$org@web30h.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <240121446059044__35603.2418822453$1446059490$gmane$org@web30h.yandex.ru> User-Agent: Mutt/1.5.21 (2010-09-15) 2015-10-28 22:04:04 +0300, ZyX: [...] > This depends on how you treat patterns. In mercurial `**` is > treated as `.*` and `*` is treated as `[^/]*`, so pattern > `a**b` matches file `a/c/b` (note. With such interpretation > transforming foo** into foo*/**, **bar into **/*bar and > foo**bar into foo*/**/*bar makes perfect sense. Though > mercurial is using regexps on a list of files, not the real > globbing, this behaviour is official and not an accident: > there are patterns like `**.c` in examples. As OP said this is > convenient in many cases. [...] That's also the behaviour of globbing in the fish shell. That means that for instance you cannot match dot files (or any pattern matching on the beggining of the file in fish. For zsh's **/.*, in fish you'd need both .* and **/.* I prefer zsh behaviour. ksh93, bash and tcsh support ** alone, but not **.c See also http://unix.stackexchange.com/questions/62660/the-result-of-ls-ls-and-ls/62665#62665 BTW, a related question: In zsh (also in yash and tcsh now), *** is the version of ** that traverses symlinks. Also, *.d/foo traverses symlinks, (*.d)#/foo doesn't ** is short for (*/)# Is there a way to do */foo without traversing symlinks (other than l=(*(/N)); l=($^l/foo(N)); (($#l)) && cmd $l)? (*/)(#c1)foo doesn't work Or (^.svn/)#foo.c that traverses symlinks? -- Stephane