Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: outputting quotes in a command
- X-seq: zsh-users 12292
- From: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: outputting quotes in a command
- Date: Wed, 05 Dec 2007 09:38:32 +0000
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <20071205092140.GB32048@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- O: Eric Smith <es@xxxxxxxxxxxx>
- References: <20071204124228.GA31450@xxxxxxxxxxxx> <200712041309.lB4D9nrk006237@xxxxxxxxxxxxxx> <20071205092140.GB32048@xxxxxxxxxxxx>
Eric Smith wrote:
> > print -r "mutt -f" ${(q):-foo} -e "'push \"<limit> ~f" ${(q):-bar} \
> > "~d <2w'\$'\\r\"'"
> >
> > That's really quite hairy: you're outputting
> >
> > mutt -f foo -e 'push "<limit> ~f bar ~d <2w'$'\r"'
> >
>
> This works fine when writing the command to a file and then
> executing that file with zsh.
>
> I would prefer to directly execute the resulting command.
Well, if you're simply executing the command rather than outputting it
then you just omit a level of quoting.
mutt -f foo -e 'push "<limit> ~f bar ~d <2w'$'\r"'
If bar is really a parameter you can do
mutt -f foo -e 'push "<limit> ~f '$bar' ~d <2w'$'\r"'
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author