Through gnuplot I am trying to print an average line on the graph, but it is not working, if I use awk command in the second part or second sub-plot command like this
plot "iops.1.log" using ($1/1000):2 with lines title "job 1",\
"<awk '{sum += $2} END {print sum/NR}' iops.1.log" with lines title "avg iops"
But if I give the value directly that I get if I run the same awk command on the bash command line, the line gets printed like this.
plot "iops.1.log" using ($1/1000):2 with lines title "job 1",\
4590 with lines title "avg iops"
The line above prints the running average line in the graph using just one value(4590) in the second subplot
What is exactly happening and why is must not be working?