Conditional Statements in Linux Bash scripts
In bash scripts it is possible to define conditional statements, or just simply if statements if you prefer. These statements work more or less the same as in many other languages, however the syntax is of course a little different.
if statements are ways to go about making decisions in bash scripts by having some kind of expression that will result in a true of false value. If the expression is true then additional code in the if statement will run, if not it will not. In addition there is also the option of including and else statement where some code that will only run if an expression evaluates to false.
There are also case statements that are like what is often referred to as a switch statement in other languages. These kinds of statements can also be thought of as a kind of conditional statement in bash scripts.