Bash Scripting β Case Statement

#90 Days DevOps Challenge#Zero To Hero#Day11 π» Challenge Accepted with #tws by Shubham Londhe π¨βπ«

Case statement in bash scripts is used when a decision has to be made against multiple choices. In other words, it is useful when an expression has the possibility to have multiple values.
Syntax:
case EXPRESSION in
Pattern_Case_1)
STATEMENTS
;;
Pattern_Case_1)
STATEMENTS
;;
Pattern_Case_N)
STATEMENTS
;;
*)
STATEMENTS
;;
esac
Output a Description for Each Option
The first line in the script starts with the shebang (#!).
It instructs the operating system to use a particular interpreter to parse the script.
We have initialized a PROFILE variable as βDevOpsβ.
Now, we are using a case statement.
Each expression has been handled through the case statement.
The last line, esac, has been used to terminate the case statement.





