Defining a variable with or without export

后端 未结 14 1665
借酒劲吻你
借酒劲吻你 2020-11-22 09:58

What is export for?

What is the difference between:

export name=value

and

name=value
14条回答
  •  一个人的身影
    2020-11-22 10:38

    Although not explicitly mentioned in the discussion, it is NOT necessary to use export when spawning a subshell from inside bash since all the variables are copied into the child process.

提交回复
热议问题