我們有父bash腳本猛砸限制父腳本的命令行參數發揚孩子的腳本參數
parent_source.bash
#!/bin/bash
source child_test.bash
的child_test.bash內
echo [email protected]
#Doing some validation checks for [email protected], for child_script command line arguments are optional
凡當執行
source parent_source.bash one two
子腳本在$ @中使用「one」和「two」,因此驗證失敗,它不會被視爲給子腳本的零參數。子腳本假設它有2個命令行參數。
但是,如果我們給孩子的命令行參數也工作正常。
可能有人請幫助我們
感謝
我們在child_test.bash出口PYTHONPATH出口路徑下等這麼多的出口語句,如果我們使用./這些都不是在當前shell反映,我們必須使用僅來源。有沒有可能實現這一點。 –