export,source

source会把定义在脚本文件中的变量放在当前shell中

export会把变量放在他所在的shell进程以及子进程shell中

子shell进程可以访问父shell进程的export 声明的变量,但是父shell进程不能访问子shell进程中的用export声明的变量(解决办法是用source)

原文地址:https://www.cnblogs.com/rocky-AGE-24/p/6849096.html