Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
comments in command/process substitution and (z) PE
- X-seq: zsh-workers 42328
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: comments in command/process substitution and (z) PE
- Date: Thu, 25 Jan 2018 19:05:41 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=ZsKnEi101PLgLcQtxe8mEbraV3NWa3p8LJuy9Z+L2dI=; b=STRTHSx6KRZlOLpmwMj6TILGS4yCa7pwOmwFRj4Nr9i4wnA3GMc3Xh+fi2kNqVpiOx O5ui8ikOUn2VE1e0wvnCcey40aoE6Uq6234jvnUxPDPAat0ZkM8CthiFXYZU4zaT3D2G NJCnJtCzibWPW1CEkiwSNVuQc7HcrlXd+j2BDwmT5xRvUO20u9o/jjc1adrBJNQeiyFv R+KqTNqR/w+DiwWiaF8YUqjhC1ZnsvdCdx0Muh4AiufFGz0XS5173Lm27sn08flufQzU jDvbcueHSqMw5NnJaoS7RTOh2vKAeNKycam0/rIY40gDE+tHSQ8l4pN0mMjw1tGl4x40 pPMw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
zshmisc(1) documents for comments:
In non-interactive shells, or in interactive shells with the
INTERACTIVE_COMMENTS option set, a word beginning with the third
character of the histchars parameter (`#' by default) causes that
word and all the following characters up to a newline to be ignored.
` command substituion prematurely ends comments, and (z) reflects that.
% setopt interactivecomments
% echo `echo foo #bar` baz
foo baz
% print -l ${(z)${:-'echo `echo foo #bar` baz'}}
echo
`echo foo #bar`
baz
$( command substitutions and parameter substitutions correctly do not
terminate the comment until the newline, but (z) PE parses the line
incorrectly.
% echo $(echo foo #bar) baz
cmdsubst>
% print -l ${(z)${:-'echo $(echo foo #bar) baz'}}
echo
$(echo foo #bar)
baz
% cat < <(echo foo #bar) baz
cmdsubst>
% print -l ${(z)${:-'cat < <(echo foo #bar) baz'}}
cat
<
<(echo foo #bar)
baz
- Matthew Martin
Messages sorted by:
Reverse Date,
Date,
Thread,
Author