I created the following script:
Code:
echo -e "\033[1mChoose something?\033[0m"
while true
do
read updatechoicenv
case "$updatechoicenv" in
"1")
echo choice 1!
break
;;
"2")
echo choice 2
break
;;
"3")
echo choice 3!
break
;;
* )
echo "No valid option received. Try again."
;;
esac
done
echo gonna do some other stuff, kthxbai!
echo i shall now return to updatechoicenv
echo
read updatechoicenv
case "$updatechoicenv" in
"1")
echo option 1 has been chosen earlier, doing some stuff based on this!
break
;;
"2")
echo option 2 has been chosen earlier, doing some stuff based on this!
break
;;
"3")
echo option 3 has been chosen earlier, doing some stuff based on this!
break
;;
esac
I would like to use the choice that has been made earlier to do some stuff further down the script, how can I do this?
Thanks,
Dennis