What does the 'export' command do?

前端 未结 3 560
被撕碎了的回忆
被撕碎了的回忆 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条回答
  •  -上瘾入骨i
    2020-12-22 19:18

    export in sh and related shells (such as bash), marks an environment variable to be exported to child-processes, so that the child inherits them.

    export is defined in POSIX:

    The shell shall give the export attribute to the variables corresponding to the specified names, which shall cause them to be in the environment of subsequently executed commands. If the name of a variable is followed by = word, then the value of that variable shall be set to word.

提交回复
热议问题