bash switch case
case $1 in
start)
#Start logic
;;
stop)
# Stop logic
;;
*)
# Default logic
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
bash switch case
case $1 in
start)
#Start logic
;;
stop)
# Stop logic
;;
*)
# Default logic
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
case shell
talk.sh#!/bin/sh
echo "Please talk to me ..."
while :
do
read INPUT_STRING
case $INPUT_STRING in
hello)
echo "Hello yourself!"
;;
bye)
echo "See you again!"
break
;;
*)
echo "Sorry, I don't understand"
;;
esac
done
echo
echo "That's all folks!"
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