Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of "export" in Bash? [duplicate]

When I customize my environment, I add PATH=$PATH:$My-own-Path in file .bash_profile.

The tutorials tell me I should use this one: export PATH=$PATH:$My-own-Path

So, what is the difference?

like image 675
Change Chang Avatar asked Dec 02 '25 01:12

Change Chang


1 Answers

To answer your exact specific question, in this particular case, there isn't any difference. Why?

Somewhere in the initialization process, the variable PATH has already been exported. A change in the variable's value which is already exported does not need another export; this is automatic. The processes fired hereafter will get the new value.

like image 183
Abhay Avatar answered Dec 04 '25 16:12

Abhay