From 2993a2094703864a8759e8b0af3e70f16c2098d2 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Wed, 8 Dec 2021 18:18:27 -0600 Subject: [PATCH] Moved line declaration out of tty conditional This way it will always be set to "" --- salt/common/tools/sbin/so-status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/common/tools/sbin/so-status b/salt/common/tools/sbin/so-status index 1b5e1d561..ab0842d46 100755 --- a/salt/common/tools/sbin/so-status +++ b/salt/common/tools/sbin/so-status @@ -180,6 +180,7 @@ print_line() { local service_name="${1}" local service_state="" ; service_state="$( parse_status "${1}" "${2}" )" # XXX: What will we do if tput isn't avalable? + local line="" if (( __tty == 1 )); then local NC; NC="$(tput sgr0)" # no color local red=""; red="$(tput setaf 1 bold)" @@ -192,7 +193,6 @@ print_line() { local columns ; columns=$(tput cols) linewidth=$(( columns - PADDING_CONSTANT - ${#service_name} - ${#service_state} )) - local line="" for i in $(seq 0 "${linewidth}"); do line="${line}-" done