Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: comment block curiosity
- X-seq: zsh-users 26317
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: comment block curiosity
- Date: Sun, 3 Jan 2021 09:26:30 -0800
- Archived-at: <https://zsh.org/users/26317>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/CAH%2Bw%3D7bDvFK5y-Dt-idLQWGzz%3DodOo%2BRhb6Tp9E%2B-KPt-5gHGg%40mail.gmail.com>
- In-reply-to: <3e0ebc9c-5cbf-f89d-c0fe-220c8d295386@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <3e0ebc9c-5cbf-f89d-c0fe-220c8d295386@eastlink.ca>
On Sun, Jan 3, 2021 at 9:10 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> alias startcomment=': <<COMMENTBLOCK'
> alias endcomment='COMMENTBLOCK'
You're overthinking this a bit, Ray.
alias startcomment=': <<\endcomment'
The backslash prevents accidental expansion of command substitutions
etc. in the block.
> [...]
> endcomment # This is ignored [...]
> COMMENTBLOCK # This ends the comment.
>
> You'd think that "endcomment' would be the alias more likely to work but
> it doesn't. Why? Can it be fixed?
Aliases do not expand inside here-documents. Even if they did, the
ending delimiter must be found literally.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author