Zsh Mailing List Archive
Messages sorted by:
Comment (# char) behavior in the sub-shell
- X-seq: zsh-workers 41656
- From: Stanislav Seletskiy <s.seletskiy@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Comment (# char) behavior in the sub-shell
- Date: Sat, 9 Sep 2017 19:33:59 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=mFQGrdn3uysLmvf5Pys2yKagMWsrg0ZGtWGrBKM67Bo=; b=FjOC14zmFSFVzWp4ijczUuEeyOnemMWx/Wr29u/p92S6oVZ5ciRiUMzH/JJdnoBs50 bcqnlr34yQqYcp1nAwg9yUv0snLHs2aMG1E0wfcNd6NGHsljYrM/3ezbdA3sqyMQGgLp q2oLmY+pyBD/wqi2boAGlscKjwagPlsV+yjaZTytNR5+p4Qzm/oniFQRjCZJImGovCn9 Ae5hvLFHsCHlx9DCcZQkbEzfD2a3eRKGhu6k/5GVgJmW+MBFnXMxk8dfbK/uBvfM4Mpu D30g9dn0b5nnBdqroWtsbCKX4qLtSX7va3gu+dXWcpACePQxWwdhWfOQsRTbgnrJfDB0 YPUQ==
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
zsh version: 5.4.2
I'm heavy user of `#`-aliases, so I like to do stuff like `seq 1 10 #
9` to grep for `9` (`alias -g -- '#'='| grep'`).
It works as expected when I'm entering command in interactive mode
without sub-shell, like:
`$ seq 1 10 # 9` — works well, I see only `9` in the output.
But when I'm trying to use same alias in the sub-shell (e.g. inside
`$()`), it doesn't work anymore:
`$ echo $(seq 1 10 # 9)` — doesn't work, I see `1 2 3 ... 10` in the output.
It seems for whatever reason everything after `#` in the sub-shell is ignored.
I've tried to disable INTERACTIVE_COMMENTS option without any success.
`$ histchars='!^' ; echo $(seq 1 10 # 9)` produces expected output,
but it's obviously will break a lot of other things.
I think it's a bug, because user should see consistent behavior in the
same interactive session. It's easily reproducible with `zsh -df` and
alias definition as I wrote above.
Messages sorted by: