mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2157 (markdown)
@@ -16,7 +16,7 @@
|
||||
|
||||
### Rationale:
|
||||
|
||||
Since `[ str ]` checks that the string is non-empty, the space inside the quotes in the problematic code causes the test to always be true.
|
||||
Since `[ str ]` checks that the string is non-empty, the space inside the quotes in the problematic code causes the test to always be true, since a string with a space can not be empty.
|
||||
|
||||
Sometimes this is also caused by overquoting an example, e.g. `[ "$foo -gt 0" ]`, which is always true for the same reason. The intention here was `[ "$foo" -gt 0 ]`.
|
||||
|
||||
|
Reference in New Issue
Block a user