From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12071 invoked by alias); 16 Nov 2012 20:01:14 -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: 17398 Received: (qmail 6761 invoked from network); 16 Nov 2012 20:01: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=0.5 required=5.0 tests=BAYES_05,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.co.uk does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1353095716; bh=ojtSvU7f2daS34tqQUpOohqKkp1SH6L/+LwtQQUV5CU=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:cc:In-reply-to:From:References:To:Subject:Date:Message-ID; b=EU291lQki462Kv81v3Kek1YB8RquC9YgdUsgjAcLWu5LxoC1W0ZQ2joidXY1ChvoI9FdySlLrtmol442DS6WRWx8l+eUAe0zRQK3hRTVsC2ytFraCD4nuCOCFjP7ymaGj7F2aCvsdgj2HVSaGY2FBbVJsXCKWNjyRRiboGGLxGM= X-Yahoo-Newman-Id: 98978.25912.bm@smtp151.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 4GTiCiEVM1lCxAJ6bCmJtJjDaNa8Q0ZyAh9GzQrv9Kyd4ab 9Cjkr50XTD22JsnTRt0xcjeazTcju8d8uCUaKGiTKixAf8Bj2zTnHCfewJZR _A1WyrO8XJp_OdXe4bERHGtvrr.re_OMfKHT9sR3XeZKPn8fhf_zug0RZsa8 A2GAHJ.nEtRVW8cMcbklmc1bPIJdS4qk64RLYeoubTHiRiXB905DBl89rnL4 QBXIzkIDfeUIoRnvwriGFBeSjSejAgEdw5pLKA.Q_764S5HukDBmvVz.wb6I e0PZdlSyLhoceaHyh6wy1msX.3BEI51s4UneMj6HowL1hPJo0S1jWDwH3HkM JNsU0TxYXkqIEtZahWfVraANhMY7.wH0.ErCk44rBiwqIMR7NCqFW8gCktUR NuUn0TWX4VmYwpPps4NXAccP0L..lnjwgMfxJmv5u X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- cc: zsh-users@zsh.org In-reply-to: <20121116180016.GJ24247@icir.org> From: Oliver Kiddle References: <20121116180016.GJ24247@icir.org> To: Matthias Vallentin Subject: Re: Applying glob qualifiers to non-variable types Date: Fri, 16 Nov 2012 20:55:15 +0100 Message-ID: <6033.1353095715@thecus.kiddle.eu> Matthias Vallentin wrote: > I have a scenario where a command gives similar output to find, .e.g., > > ./path/to/foo.ext > ./path/to/bar.ext > > I was wondering if it is possible to use glob qualifier to handle the > output in the following way: > > command | print :t:r > > where would be some magic I am missing. I tried to capture STDIN in > various ways $( solution. You can use a while loop - something like: command | while read file; do print $file:t:r done If you're using a command that, unlike print, can't be invoked for each file separately then you can use something like the following: print ${^$(command)}(:t:r) The caret is only needed if you don't set rcexpandparam. To cope with files with spaces in their names you need to use something like ${(f)^"$(command)"}(:t:r) Oliver