In order to get started there is a one question we need to take first.
What is a script.
It is nothing more than a sequence of system commands pasted in a file.
Of course we can enhance that by using for loops conditionals variables arguments.
But the truth is that in simplest case it is only a list of system commands stored in a single file.
Now instead of talking let's show it on some example to our cars I will be using Ubuntu distribution
and just I know this is not any recommendation for you to go right now and install Ubuntu.
You will be fine with Debian.
So that is Open Suse or whatever you are using.
OK let's start with opening termino one of the most new system commands are Ls.
BW The End Date S is a list of directory BW The prince name of a directory.
Very currently hour and date just shows us a date.
We can see the output of these commands right now in terminal.
So let's say did we want to display the output of those commands.
Again it's annoying to type it again.
We can instead of it create a file which will have DOS commands inside and by running that file only
we can see the desired output.
So let's create a file called for a script Dauth stage.
Have you noticed that as age extension it is a convention that tells us this file is a script.
Of course you could use instead beshi extension.
It really doesn't matter.
But let's continue with Convention
on the first line.
I will start with Shabak this line is very important and you wouldn't believe how many system administrators
do.
Huge mistake here mistake on this line can lead to not working script when deploying good on production
machine but just for now type exactly the same as me.
I will explain the charbon on separate video now onto new lines.
I will boot system commands I have previously typed directly into terminal remember.
Did you need to type each command on a separate line.
If you don't want to have any errors save and exit your editor I will exit the editor using escape and
typing Coloma WQ.
Which means what changes to file and create and it's done for script complete.
Now we need to run it but there is still some work to be done.
We need to change our script file permission.