From: Sami Kerola Date: Sun, 18 Mar 2012 20:10:35 +0000 (+0100) Subject: reset: make scripts bourne sh compliant [checkbashisms] X-Git-Tag: v2.22-rc1~572 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0660441de984582c4c2fc97fa22c0cea2c17d84;p=thirdparty%2Futil-linux.git reset: make scripts bourne sh compliant [checkbashisms] In addition strict compliance the commit will take variable name quoting, and $(command) substitution in use. $ checkbashisms reset reset.033c possible bashism in reset line 11 ('$[' should be '$(('): bot=$[ ${LINES:-`tput lines`} - 1 ] possible bashism in reset.033c line 11 (echo -e): echo -e \\033c Signed-off-by: Sami Kerola --- diff --git a/term-utils/reset b/term-utils/reset old mode 100644 new mode 100755 index 92d2539070..68de82eb1c --- a/term-utils/reset +++ b/term-utils/reset @@ -8,6 +8,6 @@ tput rmul tput rs1 tput rs2 tput rs3 -bot=$[ ${LINES:-`tput lines`} - 1 ] -if test "$bot" -le "0"; then bot=24; fi -tput csr 0 $bot +bot=$((${LINES:-$(tput lines)} - 1)) +if test "${bot}" -le "0"; then bot=24; fi +tput csr 0 ${bot} diff --git a/term-utils/reset.033c b/term-utils/reset.033c index fb9834db2b..fc7fad6b12 100755 --- a/term-utils/reset.033c +++ b/term-utils/reset.033c @@ -8,4 +8,4 @@ tput rmul tput rs1 tput rs2 tput rs3 -echo -e \\033c +printf "\\033c\n"