Inspired by this question I tried to pipe output to gnuplot and then plot it.
My pipe is:
cat file.txt |
grep CU |
perl -e 'while(<>){print +(split)[3], "\n"}' |
gnuplot file.gp
Where file.gp contains the following:
set terminal dumb
plot '<perl' using 1
The output of the pipe is:
-77.8333771886
-77.8333771886
-77.8333771886
-77.8333771886
-77.8333771886
-77.8333771886
-77.8333771886
-77.8333771886
-77.8333771886
-7.78333787544e+01
-7.78333787544e+01
Now I got this error:
plot '<perl' using 1
^
"file.gp", line 3: warning: Skipping data file with no valid points
plot '<perl' using 1
^
"file.gp", line 3: x range is invalid
Piping the output into a file and then doing gnuplot file.gp with file.gp modified to contain the filename works as expected.
What am I doing wrong here?