Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Substitution Cruft



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);}



Messages sorted by: Reverse Date, Date, Thread, Author