Defining a variable with or without export

后端 未结 14 1485
借酒劲吻你
借酒劲吻你 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:59

    To illustrate what the other answers are saying:

    $ foo="Hello, World"
    $ echo $foo
    Hello, World
    $ bar="Goodbye"
    $ export foo
    $ bash
    bash-3.2$ echo $foo
    Hello, World
    bash-3.2$ echo $bar
    
    bash-3.2$ 
    

提交回复
热议问题