Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
how to get verbatim output in command substitution
- X-seq: zsh-users 12722
- From: "Sharad Pratap" <sh4r4d@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: how to get verbatim output in command substitution
- Date: Tue, 25 Mar 2008 20:13:45 +0530
- Cc: sharad.pratap@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:mime-version:content-type; bh=hMi/r+rIFJs+MddXDcloLtQuzPh2Q9tuyXu8Q3rIvsw=; b=OT9l3z50JEJ9JaEMu72ZqSWoXJIMYPS763aac0tv6x3PQyOITw+FFGGN+C5kbot4DqAGdZtwFWit1j8d3GGE41nP5YiWutnFEuduats54uU6Th5obRf6dRwOk4MZsmHCKZur1wXjMhPw7SAP8aRtReajpnArDZBqlajrAMFJp9w=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:mime-version:content-type; b=AQoSS+oy9OUtni4K4dd269l4mBdycCqpg6n4XLNZsd7EtXAod6xPxh7ZEgd6fqxGyUODw084rk5ZtZOdBAh4uzoFeb9q3YyPKgjru0ul7PYEjB/3Vl0Stl/VThxOBRAMOLsrpIcmFGGvAI9+8A+HF49x19fzl3qeVyU/IKXOZEU=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi,
I wanted to use command substitution to assign to $mailpath array.
but both of `...` and $(...) , failed to do so.
I have checked about the usage of command substitution in section
5.1.5: Backquotes at http://zsh.sunsite.dk/Guide/zshguide05.html
In short in command substitution any quote single, doule, or back not printed verbatim,
but escaped to print by echo/print, while I need to execute verbatim output.
so my question is how to get verbatim output, in zsh using command substitution.
Any help appreciated.
This is the command whoes output I wanted to assign to $mailpath array, which from .mutt/muttrc
takes the mailbox command's argument and print in a way I wanted to assign to $mailpath.
(so I need to change only at one place.)
=======================\/=========================
% sed -n
"s/^[[:space:]]\+mailboxes[[:space:]]\+\(.*\)[[:space:]]*$/\1"\''?new
mail in $_, try mutt -f $_'\'"/p" .mutt/muttrc
/var/spool/mail/c_sharad'?new mail in $_, try mutt -f $_'
~/Mail/allusers'?new mail in $_, try mutt -f $_'
~/Mail/dust'?new mail in $_, try mutt -f $_'
...
=======================/\=========================
when I assign it array mailpath like
=======================\/=========================
% mailpath=( `sed -n
"s/^[[:space:]]\+mailboxes[[:space:]]\+\(.*\)[[:space:]]*$/\1"\''?new
mail in $_, try mutt -f $_'\'"/p" .mutt/muttrc ` )
% echo ${mailpath[3]}
in
% echo ${mailpath[2]}
mail
=======================/\=========================
While I wanted ${mailpath[3]} to be
~/Mail/dust'?new mail in $_, try mutt -f $_'
${mailpath[2]} to be
~/Mail/allusers'?new mail in $_, try mutt -f $_'
${mailpath[1]} to be ${mailpath[2]} to be
~/Mail/allusers'?new mail in $_, try mutt -f $_'
--
Regard
Sharad
Messages sorted by:
Reverse Date,
Date,
Thread,
Author