From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24715 invoked from network); 5 Sep 2005 16:33:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Sep 2005 16:33:09 -0000 Received: (qmail 55274 invoked from network); 5 Sep 2005 16:33:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Sep 2005 16:33:03 -0000 Received: (qmail 15460 invoked by alias); 5 Sep 2005 16:32:54 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9386 Received: (qmail 15447 invoked from network); 5 Sep 2005 16:32:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Sep 2005 16:32:53 -0000 Received: (qmail 54158 invoked from network); 5 Sep 2005 16:32:53 -0000 Received: from her-isrv.ionific.com (195.197.252.67) by a.mx.sunsite.dk with SMTP; 5 Sep 2005 16:32:49 -0000 Received: from her-gw.ionific.com ([195.197.252.66] helo=trews52.bothi.fi) by her-isrv.ionific.com with esmtp (Exim 3.35 #1 (Debian)) id 1ECJtn-0004T1-00 for ; Mon, 05 Sep 2005 19:32:47 +0300 Received: from azure by trews52.bothi.fi with local (Exim 3.36 #1 (Debian)) id 1ECJtn-00061Z-00 for ; Mon, 05 Sep 2005 19:32:47 +0300 To: Zsh Users' List Subject: Problem with glob qualifier e Mail-copies-to: nobody From: Hannu Koivisto Date: Mon, 05 Sep 2005 19:32:37 +0300 Message-ID: <87u0gza316.fsf@trews52.bothi.fi> User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.4 (i386-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 Greetings, The manual of zsh 4.2.1 says the following about the glob qualifier e: filename. In addition, the parameter reply may be set to an array or a string, which overrides the value of REPLY. If set to an array, the latter is inserted into the command line word by word. For example, suppose a directory contains a single file `lonely'. Then the expression `*(e:'reply=(${REPLY}{1,2})':)' will cause the words `lonely1 lonely2' to be inserted into the command line. I can verify that the example works as described. But I don't understand how to extend that to more complex cases. For instance, let's say that I would like to splice two command line arguments after each file argument produced by a glob pattern. If I have files sur and pur in the current directory, I would like to say something along the lines of echo (sur|pur)(e:'':) which, when expanded, should result to echo pur -foo bar sur -foo bar I expected echo (sur|pur)(e:'reply=(${REPLY} -foo bar)':) to do what I want but instead that results to echo -foo -foo bar bar pur sur I can't see how that follows from the quoted documentation. In any case, if my goal cannot be achieved with the glob qualifier e, is there some other brief trick to modify the list of generated filenames in such a way? -- Hannu