Okay.
Now, let's use them, Ed, as the assets that we created previously.
Now here by typing dee dee dee later.
I mean, you can see that it will remove a line.
Now press eye or depends on what you want.
I will press I so to insert mode as we learned previously.
Now here let's declare our first variable.
So var.
Underscore or let's name it first underscore one OC equal, and then let's put inside it in double quotation.
This is our first variable.
Now, how to print its value by typing the name of the variable.
As simple as that.
But before it, let's put the dollar sign.
I think we already saw that.
But here using a batch script.
Now here in this script, the first variable this is or I have made a mistake.
A typo here.
No problem.
This is our first variable.
First variable.
Okay.
Now let's run as good as such again.
And you can see.
Yeah, it will print.
This is our first variable.
Cool.
Okay, now this is a string variable.
Now, if I want, let's open as such again.
Now, what if I want to create another variable?
Let's name it.
Second, underscore far and inside it.
I want to put a command else.
Now, if I type, I less like that.
And if I equal the first variable.
And by the way, I can put that inside a double quotation like that.
And what?
This is the first period in like this and the variable and equal again the same thing.
This is the second.
Vary a bit and but the second underscore.
But right now, by the way, this to print a text and to put the value of the first variable.
And this is again for the second variable, but the second variable is here.
It will not be running as a command.
It will be as a text or string.
So if I run as the test edge, you can see this is the first variable.
This is our first variable, which is the value of the variable.
And as you can see, the second value is is else, which is as a string.
Now how to run a command and put its value inside a variable.
We will use the back quotation or back single quotation, which is the tilde mark like this.
So this means that run ls command and the value or the output of this command will be stored inside
this second variable.
By the way, not just the single back quotation.
We can use the dollar, sign open brackets and close the bracket like this.
Either way, it will work.
Now let's turn again.
Now, let's see.
You can see here it is working because RLS writing lies in the path of the batch variable.
It will show us as as edge, which means what we want.
By the way, we can put more options like, alas, dash l a for example.
Let's see what will show us.
So let's run again as the test edge here.
You can see this is the second variable total whatever.
And this is the value of the Dash L command.
Also, we can use arguments inside the bash script.
Now you can see this image.
Don't worry, I will provide you with it.
By the way, you can get it online.
This is now no secret anyway.
So the variable name inside the bash script can be zero.
As you can see, there are signs zero.
This is the name of the best script from 1 to 9.
This is the first arguments to the best script that are signed with hash tag number of arguments as
to the best script with ET here or.
But son, all arguments best to the best scripts.
Here's the exit status I think we already so this and the to double the last sign we already saw this
this is the process ID of the current script or the current batch.
Remember when we run this on the batch, the user here, the variable user, this is the user name of
the user running the script, which is in our case which will be curly hostname, the host name of the
machine random.
This will provide a random number and line number.
This is or no.
This is the current line number in the script.
I will not try all of these.
This is exercise for you to try all of these.
For now we will use this.
Just the variables or the arguments.
So for example, let's open as good as such again here, let me remove the first and the second variable.
Okay, let's leave just this equal.
Now, let's delete this.
Okay.
For example, this is whatever.
Now there are sign one instead of this.
And Turner signed to och.
So which means this is the first argument and this is the second argument.
Now let's save and quick.
So if I run as a statue without providing any argument, you can see that this is an empty, as you
can see, empty values.
But if I provide it like this.
First, then second.
You can see that.
Yeah, this is first and second.
Okay, cool.
Now an exercise for you.
I want you to try out all of those variables and the arguments or whatever.
Okay.
Also, we can use the reading user input by using the read command.
Okay.
So open the as again.
Now here.
Above that.
Let's put read and the read here.
What?
The name of the variable.
So var red var and print out this var variable.
So let's remove these actually.
So read the var.
It will ask us to provide a value or string value for var and then we will print it out.
So let's save that.
Let's run again as a search presenter.
You can see that here.
It will ask us to provide value.
So value, for example, and the value have been provided has been printed out.
Okay, cool.
Now there is another way or better way.
So actually, instead of writing this to be fancy, so let's use.
Please provide a value, for example.
And like that.
And if I run it again, you can see, please provide the value.
So just for example or whatever.
And this is just.
Okay.
Okay, cool.
And actually, this is a very handy and will be used with a lot of stuff.
Like Please provide your username, your password, or please provide the value you want to try out
or the name of the file or whatever.
Okay, cool.