Problem Statement
What is the correct syntax for an if statement in Bash?
Explanation
In Bash, conditions are enclosed in square brackets with spaces around them.
After then, you write the commands to execute if the condition is true, followed by fi to end the block.
Code Solution
SolutionRead Only
if [ $age -gt 18 ]; then echo 'Adult' fi