Skip to content

Heredoc terminated after process substitution parenthesis should be flagged #3199

Open
@ShamrockLee

Description

@ShamrockLee

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.

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