sh icon indicating copy to clipboard operation
sh copied to clipboard

interp: here-doc backslash is not preserved

Open mochja opened this issue 10 months ago • 1 comments

When a backslash is present inside here-doc it is not preserved in the output(input). See the difference with bash below:

gosh
$ cat << EOF
> test \" test
> EOF
test " test
bash
bash-3.2$ cat << EOF
> test \" test
> EOF
test \" test

Relates to:

  • https://github.com/go-task/task/issues/1538

mochja avatar Apr 10 '24 12:04 mochja

Thanks, this looks like a bug in the parser. I didn't know that heredocs treat backslashes unlike any other part of the language.

mvdan avatar Apr 28 '24 23:04 mvdan