From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9639 invoked from network); 10 Sep 2003 13:50:14 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Sep 2003 13:50:14 -0000 Received: (qmail 13520 invoked by alias); 10 Sep 2003 13:49:54 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6559 Received: (qmail 13507 invoked from network); 10 Sep 2003 13:49:54 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 10 Sep 2003 13:49:54 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [192.35.17.14] by sunsite.dk (MessageWall 1.0.8) with SMTP; 10 Sep 2003 13:49:54 -0000 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.11.7/8.11.7) with ESMTP id h8ADnrj13135; Wed, 10 Sep 2003 15:49:53 +0200 (MEST) Received: from MOWD019A.mow.siemens.ru ([163.242.196.119]) by mail2.siemens.de (8.11.7/8.11.7) with ESMTP id h8ADnqT23012; Wed, 10 Sep 2003 15:49:52 +0200 (MEST) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Wed, 10 Sep 2003 17:57:57 +0400 Message-ID: <6134254DE87BD411908B00A0C99B044F06B34FEF@mowd019a.mow.siemens.ru> From: Borzenkov Andrey To: "'Nikolai Weibull'" , "'Zsh Users'" Subject: RE: Substitution Cruft Date: Wed, 10 Sep 2003 17:57:55 +0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain > OK. This has been annoying me for some time. I must be doing something > wrong, or there must be an easier way in any case. I want to run a > command with command line options output from a shell substitution: > lprec ${(Q)${(zf)$(sed -n 's/["\$]/\\&/g;s/^\([A-Za- > z]\+\)=\(.\+\)$/--\L\1\E "\2"/;/^--[a-z-]\+/p' < $tmp)}} & > what this does is read a file ($tmp) that looks like > Option1: value1 > Option2: value2 > and turns this into > --option1 "value1" > --option2 "value2" > and this is then passed to the command 'lprec'. > Is there a simpler way than using ${(Q)${(zf)...}}? Not sure if it simpler, but (all one line) bor@itsrm2% echo ${${(f)"$(