Fix most shell hygiene issues found by shellcheck

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg
2016-10-30 02:05:31 -04:00
committed by John Hood
parent 3b21cd2425
commit 8a8f2b29ca
20 changed files with 144 additions and 115 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ sleepf()
seq_function()
{
if [ $# -lt 1 -o $# -gt 3 ]; then
if [ $# -lt 1 ] || [ $# -gt 3 ]; then
echo "bad args" >&2
fi
first=$1
@@ -35,9 +35,9 @@ seq_function()
;;
esac
while :; do
printf '%d\n' $first
printf '%d\n' "$first"
first=$(( first + incr ))
if [ $first -gt $last ]; then
if [ "$first" -gt "$last" ]; then
break
fi
done
@@ -52,5 +52,5 @@ fi
chr()
{
printf "\\$(printf %03o $1)"
printf '%b' "\\0$(printf %03o "$1")"
}