-
-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shfmt incorrectly reports "unclosed here-document" for tab-indented closing delimiter with <<- #1088
Comments
Even when trying with the following code, the error persist #!/bin/bash
bash <<-EXEC
uname -a
EXEC |
Thanks for reporting. You say you're on Windows so this appears to be a bug with CRLF line endings, which I can reproduce. |
This was referenced Nov 16, 2024
Open
Open
This was referenced Nov 16, 2024
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shfmt is incorrectly reporting an "unclosed here-document" error for a bash script that uses the <<- syntax with a tab-indented closing delimiter. This syntax should be valid according to bash heredoc documentation.
Script content (
test.sh
):Note: The closing
EXEC
and the content are indented with tabs, not spaces.Error message:
Environment:
Additional notes:
Expected behavior:
shfmt should recognize the tab-indented closing delimiter and content as valid when using the <<- syntax and not report an "unclosed here-document" error.
Steps to reproduce:
shfmt -ln bash -l -w "path\to\test.sh"
Additional readings:
Please let me know if you need any additional information or if there's a workaround for this issue. Thank you for your attention to this matter.
The text was updated successfully, but these errors were encountered: