If you're unsure if variable holds an int, you can validate its value:
#!/usr/bin/env bash
set -eu
vint() {
local v
for v; do
if echo "$v" | egrep '[^0-9]' &> /dev/null; then
printf '%s: %s: not an int\n' "$0" "$v" >&2
exit 1
fi
done
}
vint "${A-}"
if (( ${A-} )); then
echo true
else
echo false
fi
The best solutionThis is as far as I could find so fartake it.