All right, so how are we going to do all of this? Well,
the appropriate way is to use sudo vim and then we are going
to vim etc profile D and I'm going to call it sander sh.
The only requirement is that your extension ends in sh.
So what do we need? We need
alias IP config is IP addr show.
It's important if you define aliases.
If the command that you want to run contains spaces, you put the entire command between double quotes.
Then we have this variable with the name color that is set to the value red. Well, I'm going to
use export color is red and this export makes sure that the variable is available in sub shells as well.
In the question I was asking to ensure the aliases available in subshells aliases will always be available in
subshell. No need to do anything about that. Now a fun fact is that while I was explaining in
the lessons, we also created a variable color with the value green. Now who is going to win?
Well, let's figure out.
The best way to figure out is to close your terminal and to open a new terminal.
And then I'm going to use ipconfig and ipconfig. Well, that is working.
And echo dollar color is showing red.
Now why is that? Well, that is because of alphabetic order.
I use center sh in the alphabetic order. That comes after custom sh and that is why it is winning.
No more sophisticated reason than that. That's how it works.