1
00:00:00,990 --> 00:00:06,530
Flow control in a script is handled by comparisons and test statements.

2
00:00:06,570 --> 00:00:14,860
Let's look how to write some comparison using if statement here is a basic structure of an if statement

3
00:00:15,340 --> 00:00:16,570
we are using keyboard.

4
00:00:16,630 --> 00:00:24,490
If and inside the brackets we are putting some condition here is important to have space between brackets

5
00:00:24,520 --> 00:00:25,660
and condition.

6
00:00:25,660 --> 00:00:28,200
Otherwise it is an error.

7
00:00:28,480 --> 00:00:33,710
If that condition is true script will continue with the block of code after then.

8
00:00:33,730 --> 00:00:43,980
Keyboard by using keyboard f I will be telling the script that if statement ends here and we can continue

9
00:00:44,280 --> 00:00:47,810
with code which is not part of that if statement

10
00:00:50,520 --> 00:00:58,210
if we want to tell what statements should be executed when the condition is false we can use keyboard.

11
00:00:58,270 --> 00:01:06,330
Else In some cases we might want to specify if statement flow based on more conditions.

12
00:01:06,330 --> 00:01:16,950
So in such cases we are using Elif keyboard basically the flow is following a first condition is true.

13
00:01:17,010 --> 00:01:21,580
Do some statements and exit if statement errors.

14
00:01:21,600 --> 00:01:25,210
If second condition is true do some statements and exit.

15
00:01:25,220 --> 00:01:26,570
If structure.

16
00:01:26,790 --> 00:01:29,090
Else if cert condition is true.

17
00:01:29,220 --> 00:01:31,150
Do some statement and exit.

18
00:01:31,140 --> 00:01:36,060
If structure otherwise continue with statements under else keyboard.

19
00:01:38,390 --> 00:01:45,290
Some people don't like to put the keyboard down on the next new line so they putting it after the brackets

20
00:01:46,620 --> 00:01:53,800
that it is necessary to put semicolon after bracket and then the keyboard then this style of writing

21
00:01:53,830 --> 00:01:59,530
can save us numerous lines of code in our scripts as you see now in the example

22
00:02:03,380 --> 00:02:10,520
if you want to evaluate more conditions we can use double Ampersand or double bypass if you use double

23
00:02:10,550 --> 00:02:11,760
ampersand.

24
00:02:11,780 --> 00:02:16,460
Statements are a process when both conditions are true.

25
00:02:16,610 --> 00:02:20,160
If you use double type statements are a process.

26
00:02:20,300 --> 00:02:23,390
If at least the one of the statement is true

27
00:02:26,680 --> 00:02:31,600
when we want to negate if condition we are using exclamation mark.

28
00:02:31,600 --> 00:02:37,530
We can put it into brackets on the beginning or we can put it in front of brackets.

29
00:02:37,570 --> 00:02:44,200
Also there is necessary to have space between exclamation mark and condition and also between exclamation

30
00:02:44,200 --> 00:02:45,550
mark and bracket

31
00:02:48,850 --> 00:02:52,860
as a condition we can use fuel types of comparison.

32
00:02:53,110 --> 00:02:58,240
Mathematical comparison string comparison and file system related test.
