I need to run a script remotely. I am using the following shell script
for server in $servers
do
LOCAL_VAR=<some_value>
ssh $server <<EOF
command1 $LOCAL_VAR
command2..
..
exit
EOF
done
bash shows unexpected end of file syntax error. The rest of the code works fine if I remove this block. Can you please tell me the correct way of executing a script remotely.
EOFindented? It should not be.