“else” command

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

!/bin/bash
age=16
if [ $age -ge 18 ]
then
echo “You are of legal age”
else
echo “You are underage”
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 prints the message “You are underage”.