From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25148 invoked from network); 10 Sep 2003 13:22:25 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Sep 2003 13:22:25 -0000 Received: (qmail 28694 invoked by alias); 10 Sep 2003 13:21:41 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6558 Received: (qmail 28661 invoked from network); 10 Sep 2003 13:21:40 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 10 Sep 2003 13:21:40 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [213.113.203.241] by sunsite.dk (MessageWall 1.0.8) with SMTP; 10 Sep 2003 13:21:39 -0000 Received: by puritan.pcp.ath.cx (Postfix, from userid 1000) id F036C513C242; Wed, 10 Sep 2003 15:21:29 +0200 (CEST) Date: Wed, 10 Sep 2003 15:21:29 +0200 From: Nikolai Weibull To: Zsh Users Subject: Substitution Cruft Message-ID: <20030910132129.GE3743@puritan.pcp.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i 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)...}}? nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}