From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5700 invoked by alias); 27 Nov 2014 04:28:36 -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: 19456 Received: (qmail 5902 invoked from network); 27 Nov 2014 04:28:24 -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:from:date:message-id:subject:to :content-type; bh=4L2jJT6AHmfKR4nLwWmQUfwm2NbyeNXtZdrkO9rofRU=; b=bnC7qoe0zj4YLDdTJ4eXmGbgOyz9w/hllEa3VkO0mm88NiZKg2fnJTNzAbIfgLiO6K bTMhb3Dhe3h2gFDYH3hxPY8lMXh+1K+1gMk9CKg0Ygxine0y7DTaEbKkwcRxqUBDHha5 tR+8yA57t3v0GM7f+TMmFF6Z54sVWxpK62mVFrnBgylAzgs1CMNJ0enb66msQZsDr0yD 21QXDOgllK5QoD8nA/kOQm/cdWe3RZWNq4doMip01HTT0SkFD7sv2SOegJefbewuvSB5 yXvCBOzn/zOogZ5wCzPoynwZakGuzot9AtBbxGvszcjshFvHSEwypeO9Bfvq4hxRorW9 Pb6g== X-Received: by 10.112.156.42 with SMTP id wb10mr14252366lbb.17.1417062496100; Wed, 26 Nov 2014 20:28:16 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <141126175240.ZM11126@torch.brasslantern.com> References: <141126175240.ZM11126@torch.brasslantern.com> From: =?UTF-8?B?SsO2cmcgWmllZmxl?= Date: Thu, 27 Nov 2014 05:27:55 +0100 Message-ID: Subject: Re: Glob specifiers for intermediate path components To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On Thu, Nov 27, 2014 at 2:52 AM, Bart Schaefer wrote: > A third would be something like this: > > glueglob() { > emulate -R zsh -o csh_null_glob > local here there > while (( ARGC )) > do > here=( $^here$~1 ) > here=( ${^here}${2:+/} ) > shift > done > print $here > } > print -l $( noglob glueglob a(...) b(...) c(...) d(...) e(...) f(...) ) Works like a charm, thank you! > There's almost certainly a fancy expression that could be written to > split a(...)/b(...)/c(...)/d(...)/e(...)/f(...) on the slashes without > being confused by the (/) glob qualifier, but I'm not going to attempt > to write it tonight. In Perl, it could look like: $ perl -e '$_="a(.)/b(@)/c(/N)/d(*)/e(@)/f/g/h/i(/)"; while (m{((.*?)(\(.*?\))?)(/|$)}g) { print "CHF 0.96\n" }' a(.) b(@) c(/N) d(*) e(@) f g h i(/) Not sure whether this solution is waterproof though. Joerg