Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: RFC: expand $'' within heredocs



> 2022/09/29 5:30, Eric Cook <llua@xxxxxxx> 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.




Messages sorted by: Reverse Date, Date, Thread, Author