zsh-workers
 help / color / mirror / code / Atom feed
* Comment (# char) behavior in the sub-shell
@ 2017-09-09 16:33 Stanislav Seletskiy
  2017-09-09 22:46 ` Bart Schaefer
  2017-09-10 20:06 ` Peter Stephenson
  0 siblings, 2 replies; 10+ messages in thread
From: Stanislav Seletskiy @ 2017-09-09 16:33 UTC (permalink / raw)
  To: zsh-workers

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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-09-21  4:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-09 16:33 Comment (# char) behavior in the sub-shell Stanislav Seletskiy
2017-09-09 22:46 ` Bart Schaefer
2017-09-10 20:06 ` Peter Stephenson
2017-09-10 21:24   ` Stanislav Seletskiy
2017-09-10 22:27   ` Bart Schaefer
2017-09-11  8:49     ` Peter Stephenson
2017-09-11  9:42       ` Peter Stephenson
2017-09-20 11:54         ` Stanislav Seletskiy
2017-09-20 17:16           ` Bart Schaefer
2017-09-21  4:43             ` Stanislav Seletskiy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).