“case” command

The “case” command is used to test various conditions and execute a set of commands for each condition. Here is an example of how to use the “case” command in a shell script:

!/bin/bash
fruit=”banana”
case $fruit in
“apple”) echo “The fruit is an apple”;;
“orange”) echo “The fruit is an orange”;;
“banana”) echo “The fruit is a banana”;;
*) echo “The fruit is not apple, orange or banana”;;
esac

This script checks the value of the “fruit” variable using the “case” command. If the value is “apple”, the script prints the message “The fruit is an apple”.