1
00:00:01,020 --> 00:00:05,320
In order to get started there is a one question we need to take first.

2
00:00:05,450 --> 00:00:07,550
What is a script.

3
00:00:07,640 --> 00:00:13,190
It is nothing more than a sequence of system commands pasted in a file.

4
00:00:13,250 --> 00:00:21,160
Of course we can enhance that by using for loops conditionals variables arguments.

5
00:00:21,230 --> 00:00:29,420
But the truth is that in simplest case it is only a list of system commands stored in a single file.

6
00:00:29,420 --> 00:00:38,830
Now instead of talking let's show it on some example to our cars I will be using Ubuntu distribution

7
00:00:39,370 --> 00:00:44,310
and just I know this is not any recommendation for you to go right now and install Ubuntu.

8
00:00:44,380 --> 00:00:46,320
You will be fine with Debian.

9
00:00:46,320 --> 00:00:49,370
So that is Open Suse or whatever you are using.

10
00:00:50,290 --> 00:00:59,470
OK let's start with opening termino one of the most new system commands are Ls.

11
00:00:59,610 --> 00:01:09,260
BW The End Date S is a list of directory BW The prince name of a directory.

12
00:01:09,300 --> 00:01:14,590
Very currently hour and date just shows us a date.

13
00:01:14,920 --> 00:01:19,020
We can see the output of these commands right now in terminal.

14
00:01:19,060 --> 00:01:22,270
So let's say did we want to display the output of those commands.

15
00:01:22,270 --> 00:01:26,480
Again it's annoying to type it again.

16
00:01:26,500 --> 00:01:32,830
We can instead of it create a file which will have DOS commands inside and by running that file only

17
00:01:33,100 --> 00:01:35,470
we can see the desired output.

18
00:01:35,950 --> 00:01:42,580
So let's create a file called for a script Dauth stage.

19
00:01:42,650 --> 00:01:50,200
Have you noticed that as age extension it is a convention that tells us this file is a script.

20
00:01:50,240 --> 00:01:53,300
Of course you could use instead beshi extension.

21
00:01:53,300 --> 00:01:54,410
It really doesn't matter.

22
00:01:54,500 --> 00:01:56,660
But let's continue with Convention

23
00:02:00,000 --> 00:02:01,100
on the first line.

24
00:02:01,110 --> 00:02:09,640
I will start with Shabak this line is very important and you wouldn't believe how many system administrators

25
00:02:09,820 --> 00:02:10,090
do.

26
00:02:10,090 --> 00:02:17,200
Huge mistake here mistake on this line can lead to not working script when deploying good on production

27
00:02:17,200 --> 00:02:21,690
machine but just for now type exactly the same as me.

28
00:02:21,700 --> 00:02:28,150
I will explain the charbon on separate video now onto new lines.

29
00:02:28,400 --> 00:02:35,860
I will boot system commands I have previously typed directly into terminal remember.

30
00:02:36,030 --> 00:02:39,420
Did you need to type each command on a separate line.

31
00:02:39,420 --> 00:02:49,240
If you don't want to have any errors save and exit your editor I will exit the editor using escape and

32
00:02:49,240 --> 00:02:51,830
typing Coloma WQ.

33
00:02:52,150 --> 00:02:59,220
Which means what changes to file and create and it's done for script complete.

34
00:02:59,220 --> 00:03:03,470
Now we need to run it but there is still some work to be done.

35
00:03:03,480 --> 00:03:06,510
We need to change our script file permission.
