I cannot find much explanation regarding a notation in here documents. In my shell script, I am plotting a file with gnuplot.
This code works:
gnuplot <<- EOF
set xlabel "square dimension (inches)"
set ylabel "mean survival time (seconds)"
set term png
set output "${plot_file}.png"
plot "beetle.dat" using 1:2
EOF
However, if I do not include the dash in <<-
and just use <<
, this code does not work and I get the following error:
./myscript: line 118: warning: here-document at line 104 delimited by end-of-file (wanted `EOF')
./myscript: line 119: syntax error: unexpected end of file
This question might have been asked before, however due to special characters not being recognized, I cannot search for it.