Skip to content

interp: here-doc backslash is not preserved #1070

Closed

Description

@mochja

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:

Activity

  1. mvdan commented on Apr 28, 2024

    @mvdan
    Owner

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

  2. added a commit that references this issue on Feb 9, 2025
    5a9a6f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址