src/gnuplot.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if ! gnuplot -e "batch=1; PNG=\"$PNG\"; set term $PNG enhanced font \",10\"; set macros;" \
    plots > /dev/null 2> gnuplot.log; then
    gawk -v test=`basename $PWD` '
    /bad data/ { 
      bad = "";
      for (i = 1; i <= NF; i++) 
        bad = bad " " $i;
    }
    /line [0-9]+:/ {
      match ($0, "line ([0-9]+):(.*)", a);
      print test ".c:" a[1] ": warning: gnuplot:" a[2] "" bad;
      bad = "";
    }' < gnuplot.log
    rm -f gnuplot.log
    exit 1;
fi
rm -f gnuplot.log