Bash if - else command
A lot of times you need to get your script to do different things depending on particular conditions. This will give your script extreme flexibility for multiple situations or conditions. You will use something called conditional statements for this. One of the most common, yet most powerful conditionals is the if statement. Some people refer to it as the if-then statement. We will start with the most basic example of this command and then make it more and more complex.
The most basic version is if a particular condition is true than do something. If it is not true then the command does not do anything and the script moves to the next statement.
Copyright © 2016