What does the 'export' command do?

前端 未结 3 561
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 18:42

I am a little new to Linux, and I happen to run some commands blindly, in order to get things done. I thought that it will not be a waste of asking these type of questions,

3条回答
  •  春和景丽
    2020-12-22 19:15

    In simple terms, environment variables are set when you open a new shell session. At any time if you change any of the variable values, the shell has no way of picking that change. that means the changes you made become effective in new shell sessions. The export command, on the other hand, provides the ability to update the current shell session about the change you made to the exported variable. You don't have to wait until new shell session to use the value of the variable you changed.

提交回复
热议问题