mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
comparing to a string better emulates Bash (bash -c '(( "$(printf "%s\n" "0")" )); printf "%d\n" "$?"'
returns 1
)
@@ -17,7 +17,7 @@ For POSIX compliance, use
|
||||
|
||||
```sh
|
||||
variable=1
|
||||
if [ "${variable}" -ne 0 ]; then
|
||||
if [ "${variable}" != 0 ]; then
|
||||
echo variable is not zero
|
||||
fi
|
||||
```
|
Reference in New Issue
Block a user