mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2154 (markdown)
@@ -11,6 +11,10 @@ or
|
|||||||
target="world"
|
target="world"
|
||||||
echo "hello $tagret" # misspelled
|
echo "hello $tagret" # misspelled
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
echo "Result: ${mycmd -a myfile}" # trying to execute commands
|
||||||
|
|
||||||
### Correct code:
|
### Correct code:
|
||||||
|
|
||||||
var=name
|
var=name
|
||||||
@@ -22,6 +26,10 @@ or
|
|||||||
target="world"
|
target="world"
|
||||||
echo "hello $target"
|
echo "hello $target"
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
echo "Result: $(mycmd -a myfile)"
|
||||||
|
|
||||||
### Rationale:
|
### 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.
|
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