I’m trying to translate a tcsh script to a bash one. This script invokes gnuplot this way:
#!/bin/tcsh
<script commands>
gnuplot << EOF
set terminal png
<other commands>
plot <args>
I tried to just modify ‘tcsh’ to ‘bash’, but I get “here-document at line x delimited by end-of-file (wanted `EOF’)”. Why is this ?
Exactly as the error message says: you need to end the here document with the string given when it was begun, in this case, EOF. You can’t just use the end of the file to terminate the here doc.
As an example, here’s a fragment from a script where I used a here doc:
Since I began the here doc with
GPLOT, bash looks forGPLOTto indicate the end of the here doc.