Why not this? `if [ "$(($#%2))" -ne 0 ]; then`. `%` is in POSIX.