mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 11:19:45 +08:00
Updated SC2154 (markdown)
@@ -11,6 +11,10 @@ or
|
||||
target="world"
|
||||
echo "hello $tagret" # misspelled
|
||||
|
||||
or
|
||||
|
||||
echo "Result: ${mycmd -a myfile}" # trying to execute commands
|
||||
|
||||
### Correct code:
|
||||
|
||||
var=name
|
||||
@@ -22,6 +26,10 @@ or
|
||||
target="world"
|
||||
echo "hello $target"
|
||||
|
||||
or
|
||||
|
||||
echo "Result: $(mycmd -a myfile)"
|
||||
|
||||
### Rationale:
|
||||
|
||||
ShellCheck has noticed that you reference a variable that is not assigned. Double check that the variable is indeed assigned, and that the name is not misspelled.
|
||||
|
Reference in New Issue
Block a user