Im using below script on sun and it just comes back to the command prompt without running any env variables. the env variables exist in the correct directories and they run manually no problem.
#!/bin/sh
MAIL=/usr/mail/${LOGNAME:?}
# Set up the shell environment:
#set -u
#trap "echo 'logout'" 0
stty erase ^H
# Set up the shell variables:
EDITOR=vi
export EDITOR
TERM=vt220 ; export TERM
ANS='X';
while [ "$ANS" != "EXIT" ]
do
tput clear
clear
#echo " `date`"
#echo
echo " [SITE] Development Environment"
echo
echo " e-Business Suite"
echo
echo " ==================================="
echo
echo
echo " 1. ERPSIT2 Environment (ERPSIT2)"
echo
echo " 2. ERPSIT3 Environment (ERPSIT3)"
echo
echo " 3. ERPMNT2A Environment (ERPMNT2A)"
echo
echo " 4. ERPRUA6A Environment (ERPRUA6A)"
echo
echo " 5. ERPDES8 Environment (ERPDES8)"
echo
echo " 6. ERPDES6 Environment (ERPDES6)"
echo
echo " 7. ERPUAT3 Environment (ERPUAT3)"
echo
echo " 8. ERPRUA5A Environment (ERPRUA5A)"
echo
echo " 9. UNIX PROMPT"
echo
echo
echo " Please make your selection : \c"
read ANS
loop=Y
if [ "$loop" = "Y" ]; then
case $ANS in
1) . /home/viewer/ERPSIT2_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
2) . /home/viewer/ERPSIT3_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
3) . /home/viewer/ERPMNT2A_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
4) . /home/viewer/ERPRUA6A_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
5) . /home/viewer/ERPDES8_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
6) . /home/viewer/ERPDES6_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
7) . /home/viewer/ERPUAT3_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
8) . /home/viewer/ERPRUA5A_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
9) echo
exit
;;
*) echo
echo " Invalid selection - Please try again \c"
sleep 1
;;
esac
fi
done
#!/bin/sh
MAIL=/usr/mail/${LOGNAME:?}
# Set up the shell environment:
#set -u
#trap "echo 'logout'" 0
stty erase ^H
# Set up the shell variables:
EDITOR=vi
export EDITOR
TERM=vt220 ; export TERM
ANS='X';
while [ "$ANS" != "EXIT" ]
do
tput clear
clear
#echo " `date`"
#echo
echo " [SITE] Development Environment"
echo
echo " e-Business Suite"
echo
echo " ==================================="
echo
echo
echo " 1. ERPSIT2 Environment (ERPSIT2)"
echo
echo " 2. ERPSIT3 Environment (ERPSIT3)"
echo
echo " 3. ERPMNT2A Environment (ERPMNT2A)"
echo
echo " 4. ERPRUA6A Environment (ERPRUA6A)"
echo
echo " 5. ERPDES8 Environment (ERPDES8)"
echo
echo " 6. ERPDES6 Environment (ERPDES6)"
echo
echo " 7. ERPUAT3 Environment (ERPUAT3)"
echo
echo " 8. ERPRUA5A Environment (ERPRUA5A)"
echo
echo " 9. UNIX PROMPT"
echo
echo
echo " Please make your selection : \c"
read ANS
loop=Y
if [ "$loop" = "Y" ]; then
case $ANS in
1) . /home/viewer/ERPSIT2_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
2) . /home/viewer/ERPSIT3_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
3) . /home/viewer/ERPMNT2A_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
4) . /home/viewer/ERPRUA6A_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
5) . /home/viewer/ERPDES8_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
6) . /home/viewer/ERPDES6_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
7) . /home/viewer/ERPUAT3_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
8) . /home/viewer/ERPRUA5A_dbenv
cd $ORACLE_HOME
ANS="EXIT"
;;
9) echo
exit
;;
*) echo
echo " Invalid selection - Please try again \c"
sleep 1
;;
esac
fi
done