]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
reset: make scripts bourne sh compliant [checkbashisms]
authorSami Kerola <kerolasa@iki.fi>
Sun, 18 Mar 2012 20:10:35 +0000 (21:10 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 30 Mar 2012 14:48:12 +0000 (16:48 +0200)
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 <kerolasa@iki.fi>
term-utils/reset [changed mode: 0644->0755]
term-utils/reset.033c

old mode 100644 (file)
new mode 100755 (executable)
index 92d2539..68de82e
@@ -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}
index fb9834db2bdfa6b916a80d2250d059209a9b6d85..fc7fad6b1276bb7165b82d9b4f4f7bcf7fd41d13 100755 (executable)
@@ -8,4 +8,4 @@ tput rmul
 tput rs1
 tput rs2
 tput rs3
-echo -e \\033c
+printf "\\033c\n"