zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: comment block curiosity
Date: Sun, 3 Jan 2021 09:26:30 -0800	[thread overview]
Message-ID: <CAH+w=7bDvFK5y-Dt-idLQWGzz=odOo+Rhb6Tp9E+-KPt-5gHGg@mail.gmail.com> (raw)
In-Reply-To: <3e0ebc9c-5cbf-f89d-c0fe-220c8d295386@eastlink.ca>

On Sun, Jan 3, 2021 at 9:10 AM Ray Andrews <rayandrews@eastlink.ca> 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.


  reply	other threads:[~2021-01-03 17:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-03 17:09 Ray Andrews
2021-01-03 17:26 ` Bart Schaefer [this message]
2021-01-03 17:36   ` Ray Andrews
2021-01-03 17:43     ` Bart Schaefer
2021-01-03 18:30       ` Ray Andrews
2021-01-03 18:50         ` Bart Schaefer
2021-01-03 21:17           ` Ray Andrews
2021-01-03 21:31           ` Ray Andrews
2021-01-04  6:10             ` Daniel Shahaf
2021-01-04 17:09               ` Ray Andrews
2021-01-04 19:28                 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bDvFK5y-Dt-idLQWGzz=odOo+Rhb6Tp9E+-KPt-5gHGg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).