Let’s Make A Menu With case in Linux/Bash!
This here bash code shows a pointless password change utility but it shows using case and what not. Enjoy!
echo “PASSWORD CHANGE UTILITY”
echo ” “
echo -n “Enter a user name:”
echo -n “Are you sure? (y/n):”
case $choice in
sudo passwd $answer
echo -n “Password successfully changed. Press enter to continue”
echo -n “whatever, don’t change it”
# Is that cool or what?!?!