Hey,
I JUST started learning bash scripting and I'm having a bit of trouble. I'm trying to write a simple if-then loop that simply asks a question like 'Do you like pie?' and only accepts a 'yes' answer.
...so if you chose 'yes', it'd echo something like "good" and be done. If you chose 'no', it'd say "wrong answer" and ask again. If you said anything else it'd say "answer with yes or no" and ask again.
I can't seem to wrap my brain around how to do this with a 'while' loop - most examples I have are simply checking if one variable is true or false.
Thanks in advance...
I JUST started learning bash scripting and I'm having a bit of trouble. I'm trying to write a simple if-then loop that simply asks a question like 'Do you like pie?' and only accepts a 'yes' answer.
...so if you chose 'yes', it'd echo something like "good" and be done. If you chose 'no', it'd say "wrong answer" and ask again. If you said anything else it'd say "answer with yes or no" and ask again.
I can't seem to wrap my brain around how to do this with a 'while' loop - most examples I have are simply checking if one variable is true or false.
Thanks in advance...