when user select option 2 nothing happen.for testing purpose I put
echo command but is not executing .
basically when user prompt for option 2,I want to get list of database name from user separeted by space (TEST DEVL)
and put into the file seprated by new line
TEST
DEVL
after that stay on same meny
----------------------------------------------
-
-
-
-
-
-
- Main Menu * * * * * * * * * *
----------------------------------------------
[1] Start Oracle
[2] Start specifice Oracle
[3] Exit/stop
----------------------------------------------
Enter your menu choice :
i
#!/usr/bin/sh
#script to create menus and take action according to that selected menu item.
#
#
ORACLE_HOME=/u01/app/oracle/product/10.2.0.3/db
while :
do
clear
echo "----------------------------------------------"
echo " * * * * * * * Main Menu * * * * * * * * * * "
echo "----------------------------------------------"
echo "[1] Start Oracle"
echo "[2] Stop 1 Oracle"
echo "[3] Exit/stop"
echo "----------------------------------------------"
echo "Enter your menu choice :"
read yourch
case $yourch in
1)
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
# su - oracle -c "$ORACLE_HOME/bin/lsnrctl start"
is_root=`id |cut -d '(' -f2|cut -d ')' -f1`;
if [ $is_root = "root" ]
then
su - oracle -c $ORACLE_HOME/bin/dbstart
elif [ $is_root = "oracle" ]
then
$ORACLE_HOME/bin/dbstart
else
echo "You don't have permission to run this utility"
exit;
fi
;;
2)
echo "hi \c"
;;
3) exit 0
;;
*) echo "Opps!!! Please select right choice "
echo "Press a key. . ."
;;
esac
done
- Main Menu * * * * * * * * * *
-
-
-
-
-