You can combine the shell script and the sql script into a single shell script. I assume in the example that oraenv is in /usr/local/bin. On some UNIX platforms it's located elsewhere

PHP Code:
#
# Set up the oracle environment
#
export ORACLE_SID=TESTDB
export ORAENV_ASK
=NO
export PATH
=/usr/local/bin:$PATH
#
oraenv
#
sqlplus username/password <<EOF
exec myprocedure
;
exit
EOF 
To call a shell script from a stored procedure your looking at Java in the database on external procedures in C or similar.