Results 1 to 1 of 1
Hi guys.
With the lack of a goto function in korn shell i am struggling to find out how to create a menu so that if the Yes option is ...
- 12-08-2008 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 1
Yes/No Menu in Korn Shell - if Yes, Repeat
Hi guys.
With the lack of a goto function in korn shell i am struggling to find out how to create a menu so that if the Yes option is picked, it will repeat earlier code from a certain point (preferably a certain line), if No is picked, quit, or if you try and select an invalid entry, error message.
For the moment, I have:
Any help would be greatly appreciated!Code:echo "Would you like to repeat this process? Yes/No : " PS3='Please select your answer Yes or No: ' names="Yes" select _name in ${names} No do case ${_name} in No) exit ;; '') print -u2 "You have made an invalid selection! You must select one of the above [${names}]" ;; *) _myName="${_name}"; break ;; esac REPLY='' done


Reply With Quote