1 source2 export 1 source在当前shell下运行shell脚本 source 1.sh # 在当前shell下运行shell脚本, 等价于 . 1.shbash 1.sh # 创建一个新的bash shell来运行shell脚本bash -x 1.sh # -x 是调试用的,加了这个,就会把脚本中的每条命令的执行情况打印出来 2 export若创建一个变量时没有加export, 则该变量只对当前shell内生效而如果加了export, 该变量对子shell也生效