From cdcc2bc5c9a28c5eaa0f26fca7aa3a20872689e0 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 26 Apr 2011 11:00:02 +0200 Subject: Do arithmetic using bash rather than bc (Closes: #603173) --- handlers/wget | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'handlers/wget') diff --git a/handlers/wget b/handlers/wget index ebb391e..67425fc 100644 --- a/handlers/wget +++ b/handlers/wget @@ -88,9 +88,9 @@ function rotate { $nice $mv /$1.$2 /$1.tmp fi - for ((n=`echo "$2 - 1" | bc`; n >= 0; n--)); do + for ((n=$[$2 - 1]; n >= 0; n--)); do if [ -d $1.$n ]; then - dest=`echo "$n + 1" | bc` + dest=$[$n + 1] $nice $mv /$1.$n /$1.$dest $touch /$1.$dest fi @@ -128,7 +128,7 @@ fi if [ -z "$days" ]; then keep="4" else - keep="`echo $days - 1 | bc -l`" + keep=$[$days - 1] fi # lockfile setup -- cgit v1.2.3