|
goto/label command for scripting in bash shell
i am writing a program for a class, and i've run into a road blcok. i'm told that there is a goto/label command for bash shell scripting, but i've yet been able to find it.
i know that it's not proper to use goto and label commands when writing programs, because of the danger newbiness of it, but this is something i need to be able to do if i'm going to write this program.
this is what i'd like to do basically:
line # command
1: echo something
2: echo something else
3: read else
4: else=$else
5: if [ $else=yes ]
6: then echo ok
7: elif [ $else=no ]
8: then goto line 1 (this would be where i would have the goto thingy)
could anyone help me with this? i'm still fairly new to linux/unix and scripting, but i'd like to get this working.
if i can't do this, there is another way to make the program work-i just don't want to go that route because it'd take longer, as well as take more effort (in my opinoin).
thanks in advance!
|