Hello all, I created the below script....and it seemed to be working fine. My problem is i want the script to ignore rest of the things if my condition is not met but do not exit....
#!/bin/ksh
###########################
###########################
# Set name of the listener, this need to be upper or lower case
#LSNR=$1
echo "`basename $0` Start `date`."
for LSNR in $*
do
RM="rm -f"
echo "Listener name: $LSNR"
export user_id=`whoami`
export ORACLE_HOME=`ps -ef|grep tnslsnr|grep -v grep|grep -v sed|grep $user_id|grep $LSNR|awk '{print $8}'|uniq|sed "s#/bin/tnslsnr##g"`
export PATH=$ORACLE_HOME/bin:$PATH;
#check who owns the listiner
lsnr_ownr=`ps -ef|grep tnslsnr|grep -v grep|grep $LSNR|awk '{print $1}'|uniq`
if test $lsnr_ownr = $user_id; then
echo "Listener $LSNR is being ran as $lsnr_ownr owner"
else
echo "Listener $LSNR is owned by a different user -- aborting script"
echo "Run script using $lsnr_ownr user"
exit
fi
more cmd
more cmd
more cmd....
exit
so for above if $lsnr_ownr = $user_id; then it echo out something....
but if its NOT then it echo out something and EXIT.....
i do not want it to exit...just do nothing for rest of the script(more cmd, more cmd)....so how can i have it do nothing for rest of the script and exit out at very end after the more cmd ???