-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
For new checks and feature suggestions
- https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
Here's a snippet or screenshot that shows a potential problem:
#!/bin/bash
cat <<< *
# or
cat <<EOF
*
EOFHere's what shellcheck currently says:
nothing
Here's what I wanted to see:
a warning that the glob * is used literally and will not be expanded
Additional comments
i guess this could be an optional check as well
i stumbled upon this, because my editor highlighted the * in another color to signal that globbing will happen
globbing also won't work in a heredoc, even though variables do:
#!/bin/bash
cat <<EOF
*
$SHELL
EOFwhich could also be warned about,
while i wouldn't warn about this in "plaintext mode":
#!/bin/bash
cat <<'EOF'
*
$SHELL
EOFMetadata
Metadata
Assignees
Labels
No labels