Prova a utilizzare un heredoc :
#!/bin/bash
sudo -iu user oracle <<XXX
cd /tmp;
. .sourceme;
sqlplus user/password << EOF;
SPOOL logfile.lst;
@runme.sql;
spool off;
exit;
EOF;
XXX
Prova a utilizzare un heredoc :
#!/bin/bash
sudo -iu user oracle <<XXX
cd /tmp;
. .sourceme;
sqlplus user/password << EOF;
SPOOL logfile.lst;
@runme.sql;
spool off;
exit;
EOF;
XXX