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

Re: how to get verbatim output in command substitution



On Mar 25,  8:13pm, Sharad Pratap wrote:
} Subject: how to get verbatim output in command substitution

In most cases, when you want "verbatim" anything, the answer is going
to be "put double quotes around it."

However, as Stephane points out, here you don't really want "verbatim"
you want "split on newlines, not on spaces" or something to that effect.

However (part 2), your sed script appears to be inserting additional
quoting, so what you really need is to pass it through "eval" in some
manner, perhaps like this:

eval $( echo "mailpath=("; sed -n ... .mutt/muttrc; echo ")" )

You might be better off rewriting your sed to *not* insert quotes so
that you can assign it with

mailpath=( ${(f)"$(sed -n ... .mutt/muttrc)"} )

(where (f) means "split on newlines") but I think the eval above will
do it with the script as-is.



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