From 444a3ecba2ee23e520fea4eca30b28f33968ea6a Mon Sep 17 00:00:00 2001 From: ale5000 <15793015+ale5000-git@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:52:31 +0200 Subject: [PATCH] Update bits-info.sh --- tools/bits-info.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tools/bits-info.sh b/tools/bits-info.sh index 148e6d6d..09ba1192 100755 --- a/tools/bits-info.sh +++ b/tools/bits-info.sh @@ -8,19 +8,10 @@ SCRIPT_NAME='Bits info' SCRIPT_VERSION='1.4' -set -u 2> /dev/null || : -setopt SH_WORD_SPLIT 2> /dev/null || : - -echo '---' -if ! ( set -o pipefail 2> /dev/null ); then echo 'not supported'; fi -case "$(set -o || :)" in *'pipefail'*) echo 'ok'; set -o pipefail ;; *) echo 'bad' ;; esac -set -o | grep -F -e 'pipefail' -echo '---' -! command 1> /dev/null 2>&1 -v 'setopt' || { setopt 2> /dev/null SH_WORD_SPLIT && echo 'ok' || echo 'failed'; } -echo '---' - -# shellcheck disable=all -$(set -o pipefail 1> /dev/null 2>&1) && set -o pipefail || : +set 2> /dev/null -u || : +! command 1> /dev/null 2>&1 -v 'setopt' || setopt SH_WORD_SPLIT || printf '%s\n' 'Failed: setopt' +# shellcheck disable=SC3040 # Ignore: In POSIX sh, set option pipefail is undefined +case "$(set -o || :)" in *'pipefail'*) set -o pipefail ;; *) ;; esac command 1> /dev/null 2>&1 -v 'local' || { \eval ' local() { :; } ' || : # Create a dummy "local" function for shells without support for local (example: ksh)