Sleepcount for 300 seconds added. This is when things got riddiculously complicated...
[mirrors/Programs.git] / c / goertzel / sleepcount.sh
index dbfda3e5665be612749348049aafc78099519463..920e42b0d86cc4f62018c3d8595bb8e54b476407 100755 (executable)
@@ -1,9 +1,11 @@
 #!/bin/bash
-seconds=$2
+seconds="$2"
 START=$(head -n 1 "$1" | cut -f 2)
-STARTOK=$(tail -n 1 "$1.counts.$seconds" | cut -f 1)
+STARTOK=$({ tail -n 1 "$1.counts.$seconds" || echo 0; } | cut -f 1)
 STOP=$( tail -n 1 "$1" | cut -f 2)
 
+fuser "$1.counts.$seconds" &>/dev/null && exit 23;
+
 test "$STARTOK" -gt "$START" && START="$STARTOK";
 seq $START $STOP | while read MAX; do
        MIN=$(( $MAX - $seconds  ))
This page took 0.096634 seconds and 4 git commands to generate.