“elif” command

The “elif” command is used in conjunction with the “if” command to execute a command or group of commands if a certain condition is not true, but another condition is true. Here is an example of how to use the “elif” command in a shell script:

!/bin/bash
age=15
if [ $age -ge 18 ]
then
echo “You are of legal age”
elif [ $age -ge 13 ]
then
echo “You are a teenager”
else
echo “You are a child”
fi


This script checks if the “age” variable is greater than or equal to 18. If the condition is true, the script prints the message “You are of legal age”. Otherwise, it checks if the “age” variable is greater than or equal to 13. If this condition is true, the script prints the message “You are a teenager”. Otherwise, it prints the message “You are a child”.