slightly better code
authorIan Kelling <ian@iankelling.org>
Thu, 30 Mar 2017 23:33:32 +0000 (16:33 -0700)
committerIan Kelling <ian@iankelling.org>
Thu, 30 Mar 2017 23:33:32 +0000 (16:33 -0700)
log-once

index 040e2ba72d634a76c3363cc855d3997fd9f72967..56961f92f7bcae812e4ebd75daf0bc5e83623916 100755 (executable)
--- a/log-once
+++ b/log-once
@@ -65,11 +65,11 @@ state in the same directory.
         done
     fi
     glob="$c[0-9]*"
-    file=($glob); file="${file[0]}"; [[ $glob != $file ]] || file=
+    file=($glob); [[ $glob != $file ]] || file=
     if $log; then
         out=append
         if [[ $file ]]; then
-            i=${file#$c}
+            i="${file#$c}"
             if (( i < errors )); then
                 new_file=$c$((i+1))
                 mv $file $new_file