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

Re: how to get verbatim output in command substitution



On Mar 25,  3:01pm, Stephane Chazelas wrote:
}
} in list contexts, command substitution is split according to the
} $IFS special parameter.

That's not quite correct.  Zsh doesn't really have a concept of
"list context" the way (say) Perl does.  For practical purposes it
has what might be called "assignment context", and everything else.

If scalar assignment syntax is used, then splitting is not done and
the resulting variable becomes scalar (even if previously declared
as an array); otherwise splitting is done (subject to the rules of
parameter expansion and globbing as controlled by various options).

That's separate from the behavior of trimming trailing whitespace
from $(...).



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