Prova att använda en 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 att använda en 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