From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13097 invoked from network); 13 Apr 2005 16:06:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Apr 2005 16:06:11 -0000 Received: (qmail 62997 invoked from network); 13 Apr 2005 16:06:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Apr 2005 16:06:04 -0000 Received: (qmail 8512 invoked by alias); 13 Apr 2005 16:05:57 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8679 Received: (qmail 8499 invoked from network); 13 Apr 2005 16:05:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Apr 2005 16:05:57 -0000 Received: (qmail 62024 invoked from network); 13 Apr 2005 16:05:56 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 13 Apr 2005 16:05:52 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IEW00C927DRVPF0@vms044.mailsrvcs.net> for zsh-users@sunsite.dk; Wed, 13 Apr 2005 11:05:52 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j3DG5oWj009064 for ; Wed, 13 Apr 2005 09:05:50 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j3DG5oKM009063 for zsh-users@sunsite.dk; Wed, 13 Apr 2005 09:05:50 -0700 Date: Wed, 13 Apr 2005 16:05:49 +0000 From: Bart Schaefer Subject: Re: brace expansion question In-reply-to: <729088040504121813272d8ef2@mail.gmail.com> In-reply-to: <37104.202.128.83.123.1113366035.squirrel@www.world-net.net> In-reply-to: <20050413080315.GA57@DervishD> In-reply-to: <20050413111811.GA22495@globtel.pl> To: zsh-users@sunsite.dk Message-id: <1050413160550.ZM9062@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <729088040504121813272d8ef2@mail.gmail.com> <37104.202.128.83.123.1113366035.squirrel@www.world-net.net> <20050413080315.GA57@DervishD> <20050413111811.GA22495@globtel.pl> Comments: In reply to grover mitchell "brace expansion question" (Apr 12, 6:13pm) Comments: In reply to "Eric Mangold" "Re: brace expansion question" (Apr 13, 2:20pm) Comments: In reply to DervishD "Re: brace expansion question" (Apr 13, 10:03am) Comments: In reply to Mariusz Gniazdowski "Re: brace expansion question" (Apr 13, 1:18pm) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Apr 12, 6:13pm, grover mitchell wrote: } } foo1{01..10} } bar2{01..10} } } Is there any way to have zsh do a brace expansion on the contents of } this file? On Apr 13, 2:20pm, Eric Mangold wrote: } } Unfortunately, I don't see a parameter expansion flag that performs } brace expansion on the result. It seems like there ought to be one. Paramter expansion happens before brace expansion in normal evaluation order, so it'd be sufficient if the tilde flag made braces eligible for interpretation as it does with glob metacharacters. The reason it does not is mostly historical, but also for compatibility bash. (I notice that tcsh expands braces that result from parameter expansion.) } Perhaps the "e" flag should also do brace expansion [...] there is } probably a good reason it doesn't. The operations enabled by (e) all have the same evaluation order as parameter expansion (that is, they're done left to right as the parser encounters them). On Apr 13, 1:18pm, Mariusz Gniazdowski wrote: } Subject: Re: brace expansion question } } Day Wed, Apr 13, 2005 at 10:03:15AM +0200, DervishD: } > cat file | while read line ; eval print $line } } It can be done without cat: } { while read line ; eval print $line } < file Or even while read line; do eval print $line; done < file (which doesn't require the SHORT_LOOPS setopt).