![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My menu function [new code -revised] | amatuer_lee_3 | Shell Programming and Scripting | 3 | 05-18-2008 04:05 AM |
| My menu function | amatuer_lee_3 | Shell Programming and Scripting | 6 | 05-17-2008 07:19 PM |
| stuck....! | moxxx68 | UNIX for Advanced & Expert Users | 0 | 12-10-2004 08:52 PM |
| how to get the similar function in while loop or for loop | trynew | Shell Programming and Scripting | 3 | 06-17-2002 08:09 AM |
| Endless loop - Fork function failed? | cdunavent | Shell Programming and Scripting | 3 | 01-30-2002 10:12 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Menu function stuck in a loop?
I having problem when I call this cleanupmenu function within a script. It continuously loops and goes to selection * That wasn't a valid selection. I have to kill it everytime to stop it. What am I doing wrong. I use this function menu in several other scripts and I don't have this problem at all. Also, when I don't use this menu as a function and put it at the end of this script it does the same thing.
#!/bin/ksh # realname=` who -m | awk '{print $1}'` # # Create Cleanup Choice Menu Function #------------------------------------------------------------------ cleanupmenu () { echo " $realname Choose your Options" echo " " echo "1. Review Queue script before execution " echo "2. Execute Script on $QMGR" echo " " echo "x Exit Menu " echo "--->\c" | tee -a $LOG read case $REPLY in 1 ) page $QL_LOG3 ;; 2 ) runmqsc $QMGR < $QL_LOG3 | tee -a $LOG ; echo " Exiting ..Goodbye $realname!" ;; x|X ) echo " Exiting ..Goodbye $realname!" ; break;; * ) echo "$realname That wasn\'t a valid Menu Selection! Try Again." ; sleep 1 ;; esac } echo "Hello $realname" | tee $LOG echo "$realname - What Queue Manager would you like to use?: \c" | tee -a $LOG read QMGR echo "You chose $QMGR" | tee -a $LOG echo "extracting amq3 file names" sleep 1 print "dis ql(AMQ.3*);" | runmqsc $QMGR >$QL_LOG1 awk /QUEUE/ $QL_LOG1 | cut -f2 -d\( | cut -f1 -d\) | sort >$QL_LOG2 exec < $QL_LOG2 while read line ; do echo 'delete qlocal('${line}')' >>$QL_LOG3 done cleanupmenu |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Re: Menu function stuck in a loop?
Quote:
exec < /dev/tty before you invoke cleanupmenu to put standard-in back to being the tty. |
|
#3
|
|||
|
|||
|
Thanks!
|
|||
| Google The UNIX and Linux Forums |