What does “export” do in shell programming? [duplicate]
问题 This question already has an answer here: Defining a variable with or without export 14 answers As far as I can tell, variable assignment is the same whether it is or is not preceded by \"export\". What\'s it for? 回答1: Exported variables such as $HOME and $PATH are available to (inherited by) other programs run by the shell that exports them (and the programs run by those other programs, and so on) as environment variables. Regular (non-exported) variables are not available to other programs.