Basically <<EOF tells the shell that you are going to enter a multiline string until the “tag” EOF.
Example :
sqlplus / as sysdba <<EOF
select name, open_mode from v$database;
archive log list;
EOF
Â
Â
You can save the EOF output to another file
sqlplus / as sysdba << EOF > out.log
select name, open_mode from v$database;
archive log list;
EOF
This will create a new file out.log in current location which will contain output sql queries.