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

how to get verbatim output in command substitution



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