I have a db2 shell script in my home directory. It's been there so long I don't know when or how it got there. It may be part of 5799-PTL. Not helpful, I know, but here are the contents:
ls -al db2
-rwxr-xr-x 1 buck 0 646 Jul 02 2013 db2
$
cat db2
#!/QOpenSys/usr/bin/ksh
# map base name "qsh_inout" to "qsh" (just run the interpreter)
basename=${0##*/}
if [[ "$basename" = qsh_inout ]] ; then
basename=qsh
fi
args=''
for temp ; do
args="$args'"
# double embedded quotes halved by CL CALL
while [[ "$temp" = *\'* ]] ; do
args="$args${temp%%\'*}''"
temp="${temp#*\'}"
done
args="$args$temp' "
shift
done
# Copy environment variables, call utility in this process,
# do not process OS/400 messages or spooled output files
exec /QOpenSys/usr/bin/system -eiqs "CALL QSYS/QP0ZCALL ('/usr/bin/$basename' $args)"
When I CALL QP2TERM
and then issue db2 commands like db2 -S 'select * from datesample'
it runs with this script.