很简单, 用source:
#!/bin/bash echo "Begin to call another script..." source /path/to/another/script.sh #其中的变量在caller中依然有效 echo "Done"
很简单, 用source:
#!/bin/bash echo "Begin to call another script..." source /path/to/another/script.sh #其中的变量在caller中依然有效 echo "Done"
转载于:https://www.cnblogs.com/sheldonxu/archive/2012/06/14/2549447.html