zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Eric Cook <llua@gmx.com>
Cc: zsh-workers@zsh.org
Subject: Re: RFC: expand $'' within heredocs
Date: Wed, 28 Sep 2022 23:19:35 +0200	[thread overview]
Message-ID: <CAHYJk3TryFqPE9KDcY3GJBis-OULm6Xe0QDSa9OzDLzfb5ojMg@mail.gmail.com> (raw)
In-Reply-To: <5701a51d-76ff-240a-929c-054460841e80@gmx.com>

On 9/28/22, Eric Cook <llua@gmx.com> wrote:
> Hey all,
>
> bash 5.2[1] recently released and a change i found of interest is allowing
> $'' to be expanded
> within heredocs. $'' is currently the only expansion that uses the `$'
> operator that doesn't
> expand within heredocs(even $[] does); so i can see that edgecase being
> confusing in addition
> to the feature just being useful.
> cat <<eof
> hello$'\t'world
> eof
> ...

$'foo' is technically a form of quoting, not expansion, so it is
consistent the way it is now. Eg, there is no $ operator in play, the
$' together form an operator (if you want to call it that) which
begins this particular form of quotes.

% cat << EOF
"foo" 'foo' $'foo'
EOF
"foo" 'foo' $'foo'


-- 
Mikael Magnusson


  reply	other threads:[~2022-09-28 21:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 20:30 Eric Cook
2022-09-28 21:19 ` Mikael Magnusson [this message]
2022-09-29  9:03 ` Jun T

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=CAHYJk3TryFqPE9KDcY3GJBis-OULm6Xe0QDSa9OzDLzfb5ojMg@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=llua@gmx.com \
    --cc=zsh-workers@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).