From: Frank Terbeck Date: Sat, 15 Sep 2007 11:45:33 +0000 (+0200) Subject: Fixing check for terminal width X-Git-Tag: 0.3.26~2 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=59bb481296a97b4e22c6ca9b189b1024fd9856b4;hp=ea4ba6939d7e0b37d959bce2233d8159a197950d;p=grml-etc-core.git Fixing check for terminal width --- diff --git a/etc/grml/lsb-functions b/etc/grml/lsb-functions index 304ce06..d2df8c9 100644 --- a/etc/grml/lsb-functions +++ b/etc/grml/lsb-functions @@ -789,10 +789,13 @@ case "$*" in [ -n "${EBUILD}" ] && COLS=80 esac +# Setup COLS and ENDCOL so eend can line up the [ ok ] +# width of [ ok ] == 7 if [ "${COLS}" -eq 0 ] ; then - # Setup COLS and ENDCOL so eend can line up the [ ok ] COLS="$(stty size 2>/dev/null | cut -d' ' -f2)" - [ "${COLS}" -gt 0 ] || COLS=80 # width of [ ok ] == 7 + if [ -z "${COLS}" ] || [ "${COLS}" -gt 0 ] ; then + COLS=80 + fi fi if [ "${RC_ENDCOL}" = "yes" ]; then