#!/bin/bash INFILE="../../serial/foo.dat" NBLINES=2000 TMPFILE="/tmp/dd2data.$$" IMAGE="average4v.png" tail -${NBLINES} ${INFILE} | ./average4v.awk > ${TMPFILE} gnuplot << __EOC__ set term png size 800,600 set output "${IMAGE}" set grid set title "Average4v" set xlabel "minutes" set ylabel "température" set yrange [ 5.0 : 30.0] plot "${TMPFILE}" with lines __EOC__