Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
comment block curiosity
- X-seq: zsh-users 26316
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: comment block curiosity
- Date: Sun, 3 Jan 2021 09:09:52 -0800
- Archived-at: <https://zsh.org/users/26316>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/3e0ebc9c-5cbf-f89d-c0fe-220c8d295386%40eastlink.ca>
- List-id: <zsh-users.zsh.org>
Emboldened by Bart's showing how fundamental syntax might be aliased,
and knowing how dangerous that might be, yet I thought I'd play with
that. I've always thought we should have block comments and of course
you can fake it very well with:
: <<COMMENTBLOCK
foo
bar
baz
COMMENTBLOCK
... But I thought I'd try to alias that because I keep forgetting the "
: << " syntax. So:
alias startcomment=': <<COMMENTBLOCK'
alias endcomment='COMMENTBLOCK'
echo about to start a comment:
startcomment # This actually works believe it or not.
foo
bar
baz
endcomment # This is ignored, it doesn't work but no error
either.
COMMENTBLOCK # This ends the comment.
echo back to working code.
You'd think that "endcomment' would be the alias more likely to work but
it it doesn't. Why? Can it be fixed?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author