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

Re: Block comments ala Ray



On Mon, Feb 15, 2021 at 1:30 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> > On Fri, Feb 12, 2021 at 7:24 AM Matthew Martin <phy1729@xxxxxxxxx> wrote:
> > >
> > > echo foo `# a comment` bar
>
> Could we optimize away the fork, like «$(<foo)»?

Not easily.  The contents of $(...) and `...` are given a rudimentary
parse, but are preserved verbatim, so my reading is that shell has
already forked before it "knows" that the entire substitution is a
comment.  "$(<" can be treated specially because the tokens are
recognized.




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