OK, now let's use Vim Ed as assets that we created previously.
Now here, my typing Dee Dee Dee Dee letter, I mean, you can see that it will remove a line, no press
eye or depends on what you want.
I will press eye.
So to insert more, as we learned previously.
OK, now here, let's declare our first variable.
So VAR.
Underscore, or let's name it, first underscore, OK, equal, and then let's put inside it in quotation.
This is our first video of it.
OK.
Know how to print its value by typing the name of the variable as simple as that, but before it, let's
book that the last night, I think we already saw that.
But here, using a best script now here in this best script, the first variable in this is, or I haven't
made the mistake, a typo here.
No problem.
This is our first variable.
First variable.
OK, now let's run as the test again, and you can see it will print.
This is our first variable.
Cool.
OK, now this is a string variable.
Now I want let's open as such again.
Now what if I want to create another variable?
It's an image.
Second, and that is caught far and inside it, I want to put a command.
Dallas.
Now, if I type, I just 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 variable like this, and with the variable and equal again, the same thing.
This is the second.
Vary a bit.
OK.
And what their second underscore.
But right now, by the way, this to Brent as text and to what the value of the first variable, and
this is again for the second variable, but the second variable values here.
It will not be running as a comment.
It will be as a text or string.
So if I did a search, 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 L.S., which is as a string.
Now how to run a command and what its value inside a variable, we would use the back quotation or single
quotation, which is that tilde mark like this?
OK.
So this means that run as command and the value or the output of this command will be stored inside
this second variable.
By the way, not just the single that quotation, we can use the dollar, sign up in brackets and close
the bracket like this.
Either way, it would work.
OK, now listen again.
Now, let's see.
You can see.
Yeah, it is working because unless I think else in the back of the batch variable, it would show us
as as edge.
OK.
Which means what we want.
OK.
By the way, we can two more options.
Knight allows Shell.
For example, let's see what will show us.
So let's run again as datasets here.
You can see this is the second variable in total, whatever, and this is the value of the additional
comment.
OK.
Also, we can use arguments inside the best 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 one to nine.
This is the first arguments to the best script there are saying with the hashtag a number of arguments.
Best to the best script with it here or.
That sign or arguments, best to the best scripts.
He had to exit strategy.
I think we already saw this and that to double dollar sign.
We already saw this.
This is the process ID of the current script or the iconic bash.
Remember when we ran this on their bash, the use up here, the variable user?
This is the username of the user running the script, which is in our case, which will be Kelly host
name, the host name of the machine random.
And this will provide a random number and line number.
This is or no.
This is the current line number in the script.
OK.
OK, I will not try all of these.
This is an exercise for you to try all of these.
For now, we will use that's just the variable or the arguments.
OK.
So for example, let's open as such again here.
Let's really remove the first and the second variable.
OK, let's see.
Just this eco.
Now, let's delete this, OK?
For example, this is what you wanna know.
I've seen one instead of this.
And they're not saying to OK, so which means this is the first argument, and this is the second argument.
Now, when it's safe and quick, so if I, as I said without providing any argument, you can see that
this is an empty as you can see empty venues.
But if they provide it like this first, then second, you can see that, yeah, this is first and second.
OK.
Now an exercise for you.
I want you to try out all of those variables and the arguments or whatever.
OK.
Also, we can use that heating user input by using the read comment.
OK.
So open the such again.
Now here above that, let's put it read and the read here.
What the name of the variable silver read bar and print out this VAR, believe it.
OK, so let's remove these, actually.
So read the VAR.
It will ask us to provide a value or a string value for VAR, and then we will print it out.
OK, so let's say that let's run again.
As such, press enter.
You can see that here.
It will ask us to provide value so that you're OK, for example, and the value or have been provided
has been printed out.
OK, cool.
Now there is another way or better way.
So actually, instead of writing this to be fancy?
So let's use.
Please provide value, for example, and press they like that.
And if I don't do it again, you can see it.
Please provide the value.
So just for example or whatever.
And this is just OK.
OK.
And actually, this is a very handy and will be used with a lot of stuff.
OK.
Like, please provide your username, your password, or please provide the value you want to try out
or the name of the fight or whatever.
OK.