returning to previous if statements in bash

Say I’ve got the following:

echo "Would you like to blarg, or flarg?"
read -e ACT

if [ "$ACT" == "blarg" ]
then
echo "Go Blarg."
echo "Possible Blargs are Blah and Flah, or go back to the previous question."
    read -e MARV
fi

if [ "$ACT" == "flarg" ]
then
echo "Go Flarg."
echo "Possible Flargs are Blah and Flah, or go back to the previous question."
    read -e CARVE
fi
    (more if statements following general pattern)

I need to know how to do a back to go to the previous question (Blah or Flah) from what would be the answer to either MARV or CARVE, and one to go back to the first one (Flarg or Blarg).


Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.