I am wondering that the line below does not work to run the oracle command inside of a shell script:
sudo su -l oracle You should wrap your command to get it work:
su -c "dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName qualidade -sysPassword password -systemPassword password -scriptDest /u01/app/oracle/oradata/qualidade -characterSet WE8ISO8859P1" -s /bin/sh oracle I got this solution here: How to run script as another user without password?How to run script as another user without password?