diff --git a/1992/westley/whereami.alt.sh b/1992/westley/whereami.alt.sh index 61bac9c86..04195524b 100755 --- a/1992/westley/whereami.alt.sh +++ b/1992/westley/whereami.alt.sh @@ -27,14 +27,8 @@ fi # try getting the columns the simple way first: tput cols if ! COLUMNS="$(tput cols)"; then - # if tput failed for any reason try stty(1) with awk(1). - # - # Disable this warning of shellcheck as it's wrong: awk needs single quotes. - # - # SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. - # https://www.shellcheck.net/wiki/SC2016 - # shellcheck disable=SC2016 - COLUMNS="$(stty size|awk '{print $NF}')" + # if tput failed for any reason try stty(1) with cut(1). + COLUMNS="$(stty size|cut -f2 -d' ')" fi if [[ "$COLUMNS" -lt 80 ]]; then diff --git a/1992/westley/whereami.sh b/1992/westley/whereami.sh index cf36ebb1a..f15af4952 100755 --- a/1992/westley/whereami.sh +++ b/1992/westley/whereami.sh @@ -27,14 +27,8 @@ fi # try getting the columns the simple way first: tput cols if ! COLUMNS="$(tput cols)"; then - # if tput failed for any reason try stty(1) with awk(1). - # - # Disable this warning of shellcheck as it's wrong: awk needs single quotes. - # - # SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. - # https://www.shellcheck.net/wiki/SC2016 - # shellcheck disable=SC2016 - COLUMNS="$(stty size|awk '{print $NF}')" + # if tput failed for any reason try stty(1) with cut(1). + COLUMNS="$(stty size|cut -f2 -d' ')" fi if [[ "$COLUMNS" -lt 80 ]]; then