From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10599 invoked by alias); 8 Feb 2010 17:16:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27690 Received: (qmail 26321 invoked from network); 8 Feb 2010 17:16:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED autolearn=ham version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.219.227 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=PrIfmREiOjJuAzzSdBGatrFND6+BWeB8rifhFVb9pf0=; b=EGcJtdWmhuCu46fI5Qv5C8XsHHSucRRMiKwSa88ZCQ9upeO/8X/CQktozF5/Lxq7+E 0ABF7KRTqAvBgPmzko4COtqQZwkJWjgx2OI07loKtRcQsoZJECAzH2ii6F8XqVMTD3Fi GuCYVtEZrjLWNaayGfI9rEXSiHo7XkDRkjIno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tJK9Z9aU2hOdUR+mdALrd5jzjxIaxKsquUrLd+Wdefr2grfryfSsWGiA9NLezjN2L9 fwnHi3ZGa/17L0TkJ5dgK13r2Q5rEINRdk36n9pjL+q5SIAgsRz3Zu5BhyKo9EfEFMfk L4ipQdX9uIARV7ZTPWmjK9YYRsAG5hAIQHGK4= MIME-Version: 1.0 In-Reply-To: <87ljf3yk0f.fsf@ft.bewatermyfriend.org> References: <237967ef1002050715o3be2d441rcc8dbeb3e2b00483@mail.gmail.com> <87ljf3yk0f.fsf@ft.bewatermyfriend.org> Date: Mon, 8 Feb 2010 18:16:39 +0100 Message-ID: <237967ef1002080916w5fea886bi888a087ea62fc9cb@mail.gmail.com> Subject: Re: extra arguments inserted by glob thinger e:: get sorted afterwards From: Mikael Magnusson To: Frank Terbeck Cc: =?UTF-8?B?SsO2cmcgU29tbWVy?= , zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 8 February 2010 13:44, Frank Terbeck wrote: > J=C3=B6rg Sommer wrote: > [...] >>> % print -- *.sh(oNe:'reply=3D(-f $REPLY)':) >>> -f zmpc.sh -f ifs.sh -f test.sh -f script_pandora.sh >> >> Why not use $^? >> >> % print -- -f\ ${(f)^"$(print -l /bin/ls*)"} >> -f /bin/ls -f /bin/lsmod > > Because: > % print -l -- -f\ ${(f)^"$(print -l /bin/ls*)"} > -f /bin/ls > -f /bin/lsmod > > "-f /bin/ls" would be one word to the shell. And also because: # touch /bin/ls' fail' % print -- -f\ ${(f)^"$(print -l /bin/ls*)"} -f /bin/ls -f /bin/ls -f fail -f /bin/lsmod $() is almost impossible to get right wrt quoting. print -l -- -f\ ${(0)^"$(printf '%s\0' /bin/ls*)"} probably works a bit better, but of course it's still useless since the -f is not a separate parameter. As an aside, is "$(echo a b c)" the only way to get an 'inline' array in a ${} expression? I sometimes want to use a glob qualifier on a middle part of a path but then I need to use temp arrays (and I'd rather not use $() there). --=20 Mikael Magnusson