Here's a quick and dirty solution

Put the following (sql commands) in a shell script

#!/bin/sh
# tt
sqlplus -s uid/pwd@svc < select * from kk;
EOF
# end tt

at the shell prompt try the following:

$ chmod 755 tt
$ tt | grep ORA | cut -c 5-9

-amar