.test_profile内容如下:export TESTVAR=1111eccho $TESTVAR
1\ 首先,在终端运行如下命令export TESTVAR=2222echo $TESTVAR输出 2222
2\ 然后,在终端运行如下命令bash -c "source .test_profile; echo ' ---- ' $TESTVAR";输出 1111 ---- 2222
为什么不是输出 1111 ---- 1111
需要再运行下.test_profile才行