Fix 1992/westley/whereami scripts if tput fails

There was a typo: awkf instead of awk.

ShellCheck fix as well.
This commit is contained in:
Cody Boone Ferguson committed 2024-02-06 03:19:48 -08:00
1 parent d5197a5170
commit 6d32012023
2 files changed
+20 -15

No files matched your search

+10 -8
View File
@@ -23,16 +23,18 @@ fi
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
[[ -z "$CC" ]] && CC="cc"
# try getting the columns the simple way first: tput cols
COLUMNS="$(tput cols)"
if [[ "$?" -ne 0 ]]; then
# if tput failed for any reason try stty(1) with awk(1):
COLUMNS="$(stty size|awkf '{print $NF}')"
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}')"
fi
if [[ "$COLUMNS" -lt 80 ]]; then
+10 -7
View File
@@ -23,15 +23,18 @@ fi
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
[[ -z "$CC" ]] && CC="cc"
# try getting the columns the simple way first: tput cols
COLUMNS="$(tput cols)"
if [[ "$?" -ne 0 ]]; then
# if tput failed for any reason try stty(1) with awk(1):
COLUMNS="$(stty size|awkf '{print $NF}')"
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}')"
fi
if [[ "$COLUMNS" -lt 80 ]]; then