(c) Write a shell program to illustrate the case statement.
A `case` statement in a shell script is used to execute one of the several possible branches based on the value of a variable. Below is an example of a shell script using the `case` statement in Linux to illustrate how it works. This script prompts the user to input a number and then prints a corresponding message based on that input.
```bash
#!/bin/bash
# Prompt user for input
echo "Enter a number between 1 and 3: "
read num
# Case statement to match user input
___ _______ ___ __________ __________ ______ ______ ________ _____.
_______ ________ _________ ____ ____ __________ __________ ________.
_______ ______ ____ ________ _________ _______ ____.
_____ ___ ______ ___ __________ _______ ________ ________ _______.
___ ________ ____ _______ __________ _______ ____ _______ _________ _____.
___ __________ _____ ____ ___ ______.
___ __________ ________ ________ ___.
___ ______ __________ _____ ____ ____ ________ ____ __________ ____.
_________ ____ ___ ______ _________ _____ ___ _________ _________ __________ ____.
__________ ________ __________ _____ ____ _____ ___ ________ ____ __________ _________ _______.
_______ ____ __________ ____ ________ __________ ____ _______ _____ ___ _______.
________ ______ ____ _____ ________ ______ ____ _________ _______ _________ ________.
___ ____ ______ ________ __________ ______ _______ ____ __________ ________.
_____ ______ ____ ______ ____ ________.
_______ ______ __________ _____ ______ ______ ______ ____ ____ _____.
____ _______ __________ ________ _______ _______ ________.
________ __________ _______ ___ ______ ___ ______ _______ ___ _____ _______.
____ __________ _____ ________ _______ _____ ___.
_____ ___ _______ _______ ______ ______ _______ ________ ___.
_______ ________ ____ ________ __________ ____.
__________ ______ __________ ________ __________ ____ ___ _________ _____.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required