Is there a proper way to exit a function without returning to previous lines in that function?
For instance, I have a shell script with lots of functions, many of them called from within functions:
Then functionTwo will do something like:
get data from user
test data from user
if data is incorrect then go to another function called tryAgain
Echo "Do you want to try again?"
case $yesno in
If the user chooses no, instead of terminating the program, it simply returns to the next step in functionOne. So if the tryAgain function is called in functionTwo, and the user chooses no, it simply moves on to functionThree instead of exiting. The same thing occurs if I replace exit with
If the tryAgain function is called in functionFive, where there are nno more steps below it, then the exit command works.
Any idea what I'm doing wrong here? Is there a way to terminate the processing of a function?
I can post the actual script if needed, but it's really long, so I thought I'd paraphrase here.
Thanks a lot in advance for any assistance.