bash case statement
case "$1" in
start)
start ;;
stop)
stop ;;
restart)
stop; start ;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
bash case statement
case "$1" in
start)
start ;;
stop)
stop ;;
restart)
stop; start ;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
bash case statement
#!/bin/bash
read -p "Enter your choice [yes/no]:" choice
case $choice in
yes)
echo "Thank you"
echo "Your type: Yes"
;;
no)
echo "Ooops"
echo "You type: No"
;;
*)
echo "Sorry, invalid input"
;;
esac
case esac bash simple example
#!/bin/bash
echo -n "Enter the name of a country: "
read COUNTRY
echo -n "The official language of $COUNTRY is "
case $COUNTRY in
Lithuania)
echo -n "Lithuanian"
;;
Romania | Moldova)
echo -n "Romanian"
;;
Italy | "San Marino" | Switzerland | "Vatican City")
echo -n "Italian"
;;
*)
echo -n "unknown"
;;
esac
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us