1753798 Members
7322 Online
108805 Solutions
New Discussion юеВ

Re: MENU Options

 

MENU Options

some options does not work through MENU, HP-UX11i like 7 and 9 to 14 onward

kindly let me know

thanks and regards
3 REPLIES 3
Sunny123_1
Esteemed Contributor

Re: MENU Options

Hi

You have mark # for option 7 .Check your script also there are no commands from 9 to 13 in your script then how it will work????

Regards
Sunny
Suraj K Sankari
Honored Contributor

Re: MENU Options

Hi,

In you script for 7 all code are hash marked thats the reasion 7 is not working
see this

#if test $choice1 = '7'
#then
#clear
#read aaa
#cd /T24/baft24/tcserver/bin
#./TCServer.sh
#read aaa
#continue
#fi

after 7 only 8, 14, 15 and 16 are there
8 and 16 is checking telnet to localhost with port 4501

14 is showing bdf

and 15 is doing break and exit see below things

if test $choice1 = '15'
then
clear
break
exit
fi

Suraj
James R. Ferguson
Acclaimed Contributor

Re: MENU Options

Hi Syed:

Your script is approaching this the hard way.

One way is to Wrap things in a 'while true' loop like this:

#!/usr/bin/sh
while true
do
clear
tput smso
echo "Host: $(hostname). $(date "+%a %x %X %Z"). [ Available Functions ]"
tput rmso
echo "\n>>> Enter < 0 > to Exit"
echo "\n>>> Enter < l > = x"
echo "\n>>> Enter < 2 > = y"
echo "\n>>> Enter < 3 > = z"
echo "\n--> \c"
read CHOICE
case ${CHOICE} in
0 ) clear
exit 0
;;
1 ) ${HOME}/thing_1
;;
2 ) ${HOME}/thing_2
;;
3 ) ${HOME}/thing_3
;;
"") continue
;;
* )
echo "\nInvalid selection; press return to continue \c"
read BITBUCKET
;;
esac
done
...

To exit the loop and continue the encapsulating script, a 'break' statement. Otherwise after running a selected event, simply 'exit' to end the script.

Regards!

...JRF...