Skip to content

Heredoc terminated after process substitution parenthesis should be flagged #3199

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

Open
ShamrockLee opened this issue May 3, 2025 · 0 comments

Comments

@ShamrockLee
Copy link

Terminating the Bash here document after the termination of process substitution silently passes ShellCheck.

Problematic code:

cat <(cat <<EOF)
Hello, world!
EOF

Correct code:

cat <(cat <<EOF
Hello, world!
EOF
)

Bash tolerates the problematic code and behave the same as the correct code, plus a line of warning message:

bash: warning: command substitution: 1 unterminated here-document

Due to this behavior of Bash, such anti-pattern is hard to locate without going through the standard error line-by-line. Flagging it as a SC1044 or its own rule will be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant