parent.sh
echo "parent shell"
./child.shchild.sh
echo child shell发布于 2017-01-30 09:42:04
我找到了答案。我们必须使用bash调用子shell。
即bash child.sh
这背后的原因是,当我们调用子shell时,它在新shell中被执行,而我的自动化工具只在父shell中打印输出。当我使用bash调用时,它在父shell中执行子shell。
因为我使用bash,所以我使用bash执行。对于其他shell,您需要使用相应的shell关键字调用子脚本。
https://stackoverflow.com/questions/41930361
复制相似问题