export
使变量可用于子流程.
就是,
export name=value
意味着变量名可用于从该shell进程运行的any process.如果希望某个进程使用此变量,请使用export
,然后从该shell运行该进程.
name=value
表示变量范围仅限于shell,不可用于任何其他进程.你可以用它来表示循环变量,临时变量等等.
It's important to note that exporting a variable doesn't make it available to parent processes. 就是, specifying and exporting a variable in a spawned process doesn't make it available in the process that launched it.