DD2-monitor/exemple.sh

22 lines
324 B
Bash
Raw Normal View History

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