bash-gnuplot: unexpected end of file

Hi

I can't figure out why i get the "unexpected end of file".

#! /bin/bash


for file1 in /figures/*; do

                gnuplot << EOF
                set terminal postscript eps color enhanced
                set output "$file1.eps"
                set bar 1.000000
                set style rectangle back fc lt -3 fillstyle  solid 1.00 border -1
                set key inside right top vertical Right noreverse enhanced autotitles columnhead nobox
                set datafile missing '-'
                set style data linespoints
                set xlabel "Index"
                set ylabel "Distance"
                set logscale y
                set xrange [0:7]
                plot '$file1' u 4, '' u 6, '' u 8, '' u 10
                EOF

done


Any help please?

thank you

D.

The second "EOF" must start in column 1 or it will not work. i.e. remove the indentation on that line at least.

thanks a lot it works!

D.