Skip to content

Commit

Permalink
Update bits-info.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Oct 18, 2024
1 parent ca08816 commit 444a3ec
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 444a3ec

Please sign in to comment.