If Statements - Bash Scripting Tutorial
ryanstutorials.net › bash-if-statementsA basic if statement effectively says, if a particular test is true, then perform a given set of actions. If it is not true then don't perform those actions. If follows the format below: if [ <some test> ] then <commands> fi Anything between then and fi (if backwards) will be executed only if the test (between the square brackets) is true.