chiark / gitweb /
hush.in: Use `$' prefixes on variables in arithmetic expansions.
[misc] / hush.in
diff --git a/hush.in b/hush.in
index d5aebcb2d40bd7a5d77ae3420c127deb49e0a5b3..2752cdf7e045065a78a7cc8d1dc044846aa1be3e 100755 (executable)
--- a/hush.in
+++ b/hush.in
@@ -167,16 +167,16 @@ exec 3>&-
 nlog=0
 for i in "$logdir/$tag".*; do
   if [ ! -f "$i" ]; then continue; fi
-  nlog=$(( nlog + 1 ))
+  nlog=$(( $nlog + 1 ))
 done
 
 ## If there are too many, go through and delete some early ones.
 if [ $nlog -gt $maxlog ]; then
-  n=$(( nlog - maxlog ))
+  n=$(( $nlog - $maxlog ))
   for i in "$logdir/$tag".*; do
     if [ ! -f "$i" ]; then continue; fi
     rm -f "$i"
-    n=$(( n - 1 ))
+    n=$(( $n - 1 ))
     if [ $n -eq 0 ]; then break; fi
   done
 fi