-
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/sh
# shellcheck disable=SC2034
foo1="bar"
foo2="baz"
foo3="qux"
for i in 1 2 3; do
eval value="\$foo${i}"
echo "$value"
doneHere's what shellcheck currently says:
Using version 0.11.0:
In test.sh line 10:
echo "$value"
^----^ SC2154 (warning): value is referenced but not assigned.
For more information:
https://www.shellcheck.net/wiki/SC2154 -- value is referenced but not assig...
Here's what I wanted to see:
No warnings. Detect a variable has been assigned in eval value=... and don't warn about it: SC2154 (warning): value is referenced but not assigned.
Metadata
Metadata
Assignees
Labels
No labels