DD2-monitor/exemple.sh

22 lines
332 B
Bash
Raw Normal View History

2018-12-06 02:30:13 +11:00
#!/bin/bash
DATAFILE=/tmp/fake-datafile
2018-12-06 03:58:55 +11:00
#----- collect the datas
2018-12-06 02:30:13 +11:00
> ${DATAFILE}
2018-12-06 02:38:03 +11:00
for s in $(seq 1 20)
2018-12-06 02:30:13 +11:00
do
2018-12-07 18:52:41 +11:00
v=$(./fake-values -s -t 1 2> /dev/null)
2018-12-06 03:58:55 +11:00
echo $s $v >> ${DATAFILE}
2018-12-06 02:30:13 +11:00
done
2018-12-06 03:58:55 +11:00
#----- do dome useless computations
awk '
NR==1 { debut = $2 }
{ print $2-debut, $3 }
' \
< ${DATAFILE}
2018-12-06 02:48:53 +11:00