diff --git a/tools/bits-info.sh b/tools/bits-info.sh index fec8d746..0c58d1f8 100755 --- a/tools/bits-info.sh +++ b/tools/bits-info.sh @@ -15,7 +15,9 @@ set -u 2> /dev/null || : case "$(set -o || :)" in *'pipefail'*) set -o pipefail || printf 1>&2 '%s\n' 'Failed: pipefail' ;; *) ;; esac # The "obosh" shell does NOT support "command" while the "posh" shell does NOT support "type" -{ command 1> /dev/null -v 'command'; } 2> /dev/null || command() +{ + command 1> /dev/null -v 'command' +} 2> /dev/null || command() { test "${1-}" = '-v' || exit 255 shift @@ -909,7 +911,11 @@ main() done _shell_arithmetic_bit="$(convert_max_signed_int_to_bit "${_max}")" || _shell_arithmetic_bit='unknown' - tmp_var="$(get_max_unsigned_int_of_shell_printf)" || : + # Some shells do NOT allow this, so we hide the errors + tmp_var="$(printf '%u\n' '-1')" 2> /dev/null || : +echo '---' +echo "${tmp_var}" +echo '---' _shell_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}")" || : tmp_var="$(awk -- 'BEGIN { printf "%u\n", "-1" }')" || :