comparing to a string better emulates Bash (bash -c '(( "$(printf "%s\n" "0")" )); printf "%d\n" "$?"' returns 1)

Lucas Larson
2025-09-27 22:48:52 -04:00
parent a878a44f8b
commit e2d5fa481f

@@ -17,7 +17,7 @@ For POSIX compliance, use
```sh ```sh
variable=1 variable=1
if [ "${variable}" -ne 0 ]; then if [ "${variable}" != 0 ]; then
echo variable is not zero echo variable is not zero
fi fi
``` ```