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

Re: Block comments ala Ray



2021-02-12 07:30:23 -0800, Bart Schaefer:
> On Thu, Feb 11, 2021 at 11:40 PM Stephane Chazelas
> <stephane@xxxxxxxxxxxx> wrote:
> >
> > :||:<<'# some comment'
> 
> That's exactly what the zsh-users discussion has been telling Ray he
> should not do, because at some point it's not going to work the way he
> expects.
[...]

How so?

That construct is pretty idiomatic.

Note:
- the :|| to prevent the temp file containing the here-doc from
  even being created and
- the *quoted* delimiter (here "# some comment") to prevent
  expansions being performed inside the here-doc

That can even be aliased:

alias START_COMMENT=':||:<<"END_COMMENT"'

How would it be different from your !# .. #! ?

-- 
Stephane




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