GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sleepcount for 300 seconds added. This is when things got riddiculously complicated...
[mirrors/Programs.git]
/
c
/
goertzel
/
sleepcount.sh
diff --git
a/c/goertzel/sleepcount.sh
b/c/goertzel/sleepcount.sh
index dbfda3e5665be612749348049aafc78099519463..920e42b0d86cc4f62018c3d8595bb8e54b476407 100755
(executable)
--- a/
c/goertzel/sleepcount.sh
+++ b/
c/goertzel/sleepcount.sh
@@
-1,9
+1,11
@@
#!/bin/bash
#!/bin/bash
-seconds=
$2
+seconds=
"$2"
START=$(head -n 1 "$1" | cut -f 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)
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 ))
test "$STARTOK" -gt "$START" && START="$STARTOK";
seq $START $STOP | while read MAX; do
MIN=$(( $MAX - $seconds ))
This page took
0.103163 seconds
and
4
git commands to generate.