Flow control in a script is handled by comparisons and test statements.
Let's look how to write some comparison using if statement here is a basic structure of an if statement
we are using keyboard.
If and inside the brackets we are putting some condition here is important to have space between brackets
and condition.
Otherwise it is an error.
If that condition is true script will continue with the block of code after then.
Keyboard by using keyboard f I will be telling the script that if statement ends here and we can continue
with code which is not part of that if statement
if we want to tell what statements should be executed when the condition is false we can use keyboard.
Else In some cases we might want to specify if statement flow based on more conditions.
So in such cases we are using Elif keyboard basically the flow is following a first condition is true.
Do some statements and exit if statement errors.
If second condition is true do some statements and exit.
If structure.
Else if cert condition is true.
Do some statement and exit.
If structure otherwise continue with statements under else keyboard.
Some people don't like to put the keyboard down on the next new line so they putting it after the brackets
that it is necessary to put semicolon after bracket and then the keyboard then this style of writing
can save us numerous lines of code in our scripts as you see now in the example
if you want to evaluate more conditions we can use double Ampersand or double bypass if you use double
ampersand.
Statements are a process when both conditions are true.
If you use double type statements are a process.
If at least the one of the statement is true
when we want to negate if condition we are using exclamation mark.
We can put it into brackets on the beginning or we can put it in front of brackets.
Also there is necessary to have space between exclamation mark and condition and also between exclamation
mark and bracket
as a condition we can use fuel types of comparison.
Mathematical comparison string comparison and file system related test.