From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: RFC: expand $'' within heredocs
Date: Thu, 29 Sep 2022 18:03:47 +0900 [thread overview]
Message-ID: <DE336ECF-032C-4F0F-9253-10A97D9AF698@kba.biglobe.ne.jp> (raw)
In-Reply-To: <5701a51d-76ff-240a-929c-054460841e80@gmx.com>
> 2022/09/29 5:30, Eric Cook <llua@gmx.com> wrote:
>
> cat <<eof
> hello$'\t'world
> eof
I think bash-5.2 does not substitute $'\t' by a TAB in this case.
Here-document is something like a string quoted by "...". All of
bash-5.1, 5.2 and zsh do not replace $'\t' by a TAB in
$ echo -E "foo$'\t'bar"
In the following example:
$ a=$'\tHello'
$ cat <<EOF
${a#$'\t'}
EOF
5.2 removes the TAB (as zsh does) and just outputs 'Hello',
while 5.1 does not remove the TAB.
prev parent reply other threads:[~2022-09-29 9:09 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
2022-09-29 9:03 ` Jun T [this message]
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=DE336ECF-032C-4F0F-9253-10A97D9AF698@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--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).