make shell math operations style more succulent

Convert the style:
	var=$((${var} + 1))
to:
	: $(( var += 1 ))

The latter is easier to read imo.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger
2011-11-10 21:46:08 -05:00
parent 0510c473d4
commit ef1ff1b4f2
32 changed files with 98 additions and 98 deletions

View File

@@ -8,14 +8,14 @@ RC_GOT_FUNCTIONS="yes"
eindent()
{
EINFO_INDENT=$((${EINFO_INDENT:-0} + 2))
: $(( EINFO_INDENT = ${EINFO_INDENT:-0} + 2 ))
[ "$EINFO_INDENT" -gt 40 ] && EINFO_INDENT=40
export EINFO_INDENT
}
eoutdent()
{
EINFO_INDENT=$((${EINFO_INDENT:-0} - 2))
: $(( EINFO_INDENT = ${EINFO_INDENT:-0} - 2 ))
[ "$EINFO_INDENT" -lt 0 ] && EINFO_INDENT=0
return 0
}

View File

@@ -59,7 +59,7 @@ do_unmount()
eend 1
else
local sig="TERM"
retry=$(($retry - 1))
: $(( retry -= 1 ))
[ $retry = 1 ] && sig="KILL"
fuser $f_kill$sig -k $f_opts \
"$mnt" >/dev/null 2>&1

View File

@@ -9,17 +9,17 @@ tret=0
ebegin "Testing yesno()"
for f in yes YES Yes true TRUE True 1 ; do
if ! yesno $f; then
tret=$(($tret + 1))
: $(( tret += 1 ))
echo "!$f!"
fi
done
for f in no NO No false FALSE False 0 ; do
if yesno $f; then
tret=$(($tret + 1))
: $(( tret += 1 ))
echo "!$f!"
fi
done
eend $tret
ret=$(($ret + $tret))
: $(( ret += $tret ))
exit $ret