OK, now let's start with environment variables.
Now, when you open a terminal window and you bash process, which has its own environment, variables
is initialized and these variables are form of global storage for various settings inherited by any
application that are run during that terminal session.
So opening the terminal here?
OK, I want to increase the font size a little bit.
OK.
It's clear the screen now here we have the first environment variable, which called the best, and
we already saw it.
So I will use the eco command and what there are saying and the name of the variable.
And this is not just the variable, it is environment variable, which means it is for the system.
So he called Beth here.
It will start showing us the bath where clinics will start looking to check for comments.
We have other environment variables like the user so equal user.
Here it will show us what is the current user, which is Kelly.
And by the way, we can see that from here, which is Kelly.
We can see the working directory, so by typing the BWT, we know that we are inside home canning now
we can use Eco Star or Dollar Sign BW Rd, it would show us Home Kelly as well.
OK?
Also, we can use another environment variable, which is home.
This is the home directory for the current user, which is home.
As we saw, OK, by the way, we are inside the tilde.
That's why bwt, it will show us the same value.
So if I go, for example, to desktop.
OK, now if I type B, it will print the working day to read Please don't get confused, OK, be ready
or equal that p wd it would show us home Kelly Desktop, which is where is the current directory or
print working directly or the current directory?
Which is here.
All right.
But eco home, it will show us the home directory for the current user, which is kidding.
Now what if we want to create a new variable inside the bash?
So first, let's clean the screen.
I want to declare this variable VAR one equal.
For example, one six eight.
For example, it's split inside that Google dot com.
OK, Google dot com.
All right.
So if I type equal dollars sign VAR one, it will show us Google dot com.
But if I type, or if I open a new terminal or control shifting and and if I type eco VAR one again.
OK.
It would show us nothing.
Why?
Because we open a new chairman session, so this variable is inside the current process.
So again, if I type Bash Command and Bash Command here is to open a new bash inside this process,
so it will be considered as a process if I type eco VAR one.
It will show us nothing.
So how to make this very available for all the sub processes?
Well, first this button the exit command.
This is to exit from the current situation or by typing control.
OK, so at the exit.
Now, if I type Eq. again, you can see that it is Google Dot com.
No, I will use command called export.
So this export VAR one equal.
YouTube dot com, for example.
If I type equal born this time, it would be YouTube dot com.
Now if I open a new bash, OK?
Busted ring or a process?
If I thought it could bar one, it will be here, which is YouTube dot com.
OK, so far, so good.
Now, if I type control D or exit clear the screen eco bar one.
Yeah, YouTube dot com is still here, so we will use export command for such things to have this variable
for all the sub processes.
Alright, now what is the use of the variable?
Of course, we can use it in scripting out of sync.
So for example, Bing, then I sign over one.
This will start bringing YouTube dot com.
But again, don't do this on life targets by the way of being will not do anything harmful.
But please don't do any scanning or any any sense, whatever on life targets, because you may get in
trouble.
Now we have special variables.
First is the screen.
The first one, which is equal, though don't sign dollar sign.
So here it will bring us the current process ID or ID.
So the current ID.
Opted for this bash, terming that process is like this, no, OK, one thousand one hundred five.
So to make sure open a new bash, no type equal, they're not saying they're not sane.
You can see that.
Oh, it is different, which means this is another bash process as a separate process inside this batch
process.
And it would show us that pretty well.
So we have the equal.
So first, the split from dispatch, clear screen equal, then up sign and question mark.
So this to tell us what is the status of the last running comment so that it's zero, which means it
is run successfully?
Other than that, it will be considered filled.
So for example, let's put this command.
This is not the command.
This is an error.
As you can see, command not found.
If I type equal the last question mark, it would be one hundred twenty seven, which means there was
an error.
OK, but if I run again, if I run it again, what is the last command which is equal that I sign?
So this will be zero?
All right, good.
So far, so good.
So this will give us the status of the last running command.
If it is zero, which means successful, other than that, it will be considered failed.
Now to see all the variables.
So for example, we have that VAR one.
Remember or VAR one here.
So to see all the environmental variables or the variables run the command and so on, run it like that.
And you can see that here is all of the commands are here or the variables.
I mean.
OK.
So you can see that, yeah, VAR one it is here.
VAR one equal YouTube dot com.
So all of the environment variable that are here inside that the bash process will be here.
OK, now if I quit again from it, from the process, if I run it again, this increase the font size
equal VAR one you can see, Oh, it is not here.
OK.
If I type in the same thing.
Warren is not here.
As you can see, why is that?
We will talk about this later on.
There is something called the bash RC, OK, here.
So I was on this command at the cat that bash our see here we can.
But whatever variables, then it would be exported each time we run the bash program or Tanami.
Don't worry, we will talk about this in detail later on.
For now, keep that in your mind.