Aug 27, 2001 #1 RajD Technical User Aug 23, 2001 53 US Hi, How do I write "GOTO Label" in KSH script?(If possible at all)
Aug 27, 2001 1 #2 raider2001 Technical User Apr 27, 2001 488 US My Unix Shells book says that there is no goto for the Korn Shell. Upvote 0 Downvote
Aug 28, 2001 1 #3 MoisDude MIS Jan 3, 2001 68 PR What you can actually do is create some sort of "defined fuctions" Ex. this is a menu sript ok! ---Cut Here?--- #!/bin/ksh LOGO=" Compaq Tru64 Menu" #------------------------------------------------------ # DISPLAY FUNCTION DEFINITION #------------------------------------------------------ themenu () { clear echo `date` echo "\t\t\t" $LOGO echo "\t\tSelecct one:" echo "\t\t\t" $amenu echo "\t\t\t" $bmenu echo "\t\t\tx. Exit Menu" echo $MSG echo echo Selecciona presionando una letra y luego ENTER ; } #------------------------------------------------------ # MENU FUNCTION DEFINITIONS #------------------------------------------------------ badchoice () { MSG="Bad Choice friend.." ; } apick () { ps -fea |grep Apache* |more ; echo Press Enter ; read DUMMY ; } bpick () { ps -fea |grep Apache* |more ; echo Press Enter ; read DUMMY ; } #------------------------------------------------------ # MAIN LOGIC #------------------------------------------------------ MSG= while true do themenu read answer MSG= case $answer in a|A) apick;; b|B) bpick;; x|X) break;; *) badchoice;; esac done ---Cut Here? --- Or something like that!!! I got a lot of help for this menu from another post here in Tech Tips... Search for scripts in the menus Good luck... L8ter! Upvote 0 Downvote
What you can actually do is create some sort of "defined fuctions" Ex. this is a menu sript ok! ---Cut Here?--- #!/bin/ksh LOGO=" Compaq Tru64 Menu" #------------------------------------------------------ # DISPLAY FUNCTION DEFINITION #------------------------------------------------------ themenu () { clear echo `date` echo "\t\t\t" $LOGO echo "\t\tSelecct one:" echo "\t\t\t" $amenu echo "\t\t\t" $bmenu echo "\t\t\tx. Exit Menu" echo $MSG echo echo Selecciona presionando una letra y luego ENTER ; } #------------------------------------------------------ # MENU FUNCTION DEFINITIONS #------------------------------------------------------ badchoice () { MSG="Bad Choice friend.." ; } apick () { ps -fea |grep Apache* |more ; echo Press Enter ; read DUMMY ; } bpick () { ps -fea |grep Apache* |more ; echo Press Enter ; read DUMMY ; } #------------------------------------------------------ # MAIN LOGIC #------------------------------------------------------ MSG= while true do themenu read answer MSG= case $answer in a|A) apick;; b|B) bpick;; x|X) break;; *) badchoice;; esac done ---Cut Here? --- Or something like that!!! I got a lot of help for this menu from another post here in Tech Tips... Search for scripts in the menus Good luck... L8ter!