1 export 作用 将一个变量导出,以给其他shell程序使用,配合source使用。
2 source 作用在本shell程序中执行,不启动子shell。
原因:./xxx.sh 启动时,启动的是子shell,此时export出的变量是不能被父类使用的,所以需要使用source 来执行,source。
1 export 作用 将一个变量导出,以给其他shell程序使用,配合source使用。
2 source 作用在本shell程序中执行,不启动子shell。
原因:./xxx.sh 启动时,启动的是子shell,此时export出的变量是不能被父类使用的,所以需要使用source 来执行,source。