Depending on how your PATH environment variable is set, you might need ./test.sh instead of test.sh . Either way, you need to have execute permissions set on test.sh as set by:
chmod +x test.sh
If you're going to run it from cron , you'll need to specify an absolute pathname to test.sh and every file referenced in test.sh (whether it is a data file or the name of a utility) will need to use an absolute pathname unless you use something to set up the environment of the script to be run in the directory containing your data files and has PATH set appropriately for all of the commands being invoked by your script.
Regarding running SQLPlus via su (which might explain the "does nothing" element of your question), here's an example, substituting values as necessary!:
[root@ora11 tmp]# cat testScript
su - oracle -c '
ORAENV_ASK=NO
ORACLE_SID=DB1
. oraenv
sqlplus / as sysdba << !
select 33 from dual;
!
'
[root@ora11 tmp]# ./testScript
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 21 01:26:45 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
33
----------
33
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
You likely don't have to use su at all, if you're root, and this won't work if you're not root.
When you use cron to run a job, cron will run it in the background on its own and the cron job will not be stopped whether you are logged in when the script starts or not, whether you log out while the script is running or not, and (in all likelihood) will not run in the directory where you issued the job for cron to run.