From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12421 invoked from network); 26 Mar 2006 18:37:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Mar 2006 18:37:45 -0000 Received: (qmail 65809 invoked from network); 26 Mar 2006 18:37:39 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2006 18:37:39 -0000 Received: (qmail 19205 invoked by alias); 26 Mar 2006 18:37:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22388 Received: (qmail 19195 invoked from network); 26 Mar 2006 18:37:36 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Mar 2006 18:37:36 -0000 Received: (qmail 65550 invoked from network); 26 Mar 2006 18:37:36 -0000 Received: from mta07-winn.ispmail.ntl.com (HELO mtaout01-winn.ispmail.ntl.com) (81.103.221.47) by a.mx.sunsite.dk with SMTP; 26 Mar 2006 18:37:35 -0000 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20060326183734.FOBQ29343.mtaout01-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Sun, 26 Mar 2006 19:37:34 +0100 Received: from pwslaptop.csr.com ([82.6.97.150]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20060326183734.QBQJ15350.aamtaout02-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 26 Mar 2006 19:37:34 +0100 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.4/8.13.4) with ESMTP id k2QIbRve004390 for ; Sun, 26 Mar 2006 19:37:27 +0100 Received: from pwslaptop.csr.com (pws@localhost) by pwslaptop.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k2QIbOow004386 for ; Sun, 26 Mar 2006 19:37:27 +0100 Message-Id: <200603261837.k2QIbOow004386@pwslaptop.csr.com> X-Authentication-Warning: pwslaptop.csr.com: pws owned process doing -bs From: Peter Stephenson To: Zsh hackers list Subject: Re: Quoting =(command) In-Reply-To: Message from "A. Wik" of "Sun, 26 Mar 2006 16:37:56 -0000." <20060326161218.U67912@dynamite.narpes.com> Date: Sun, 26 Mar 2006 19:37:23 +0100 [This is probably more in the line of zsh-users.] "A. Wik" wrote: > > How do I quote the =() syntax that returns a the > name of a temporary file containing the output of ? > > Example: star is an improved tar program that can take a list of > files to archive through the = command-line parameter - in > this case, the list is to be generated by the find program: > # star -cv f=etc-bak.tar -C / list==(cd / ; find ./etc -newer /tmp/mtime. > ref) > zsh: parse error near `)' Do you mean star takes a *file containing* the list of files to archive? If it was just the list itself, then you would use "$(...)". If you really do want a file name containing the list, I think you're in trouble because the code seems to indicate =(...) only works at the start of the word: as the manual says, a full command argument must be in that form. You can keep the scoping benefit (i.e. the temporary lasts as long as it needs to and is then deleted) using something like: star_list() { star -cv f=$1 -c / list=$2 } star_list etc-bak.tar =(cd / ; find ./etc -n newer /tmp/mtime.ref) By the way, you can get rid of find, too: ntr() { [[ $REPLY -nt /tmp/mtime.ref ]] } star_list etc-bak.tar =(cd /; print -l ./etc/**/*(+ntr)) With older versions of the shell, you need e:ntr: instead of +ntr. -- Peter Stephenson Web page still at http://www.pwstephenson.fsnet.co.uk/