Applies to: gnuplot 5.4.5 (and all previous? also present in 5.2)
Linux - Ubuntu 20.04.5 LTS
The -e
option does not accept newlines to separate commands., and it should.
This works:
$ gnuplot -persist -e "
plot sin(x)
"
This does not:
$ gnuplot -persist -e "
set xtics
plot sin(x)
"
line -1: undefined variable: plot
This works:
$ gnuplot -persist -e "
set xtics ;
plot sin(x)
"
This does not:
$ gnuplot -persist -e "
# this causes the entire script to be a comment
set xtics ;
plot sin(x)
"
I don't see why ignoring newlines in -e
is a feature here. All the other commands I know use newlines as expected line separators in -e
strings, e.g:
$ sed -ne '
1p
10p
$p
' /etc/passwd
Please make newlines work as newlines inside -e
strings, or if you're worried about backwards compatibility then add another option, say -E
, that permits a proper script with newlines to be passed as a command line argument.
Ticket moved from /p/gnuplot/bugs/2555/
Can't be converted: