执行我的shell脚本时出现错误
alias abs='~/local/bin/abs'
echo $(which abs)
source /home/rundeck/.bashrc # included alias abs as well. I'm just sourcing it twice.
python batch_update_autobuilds.py <- I'm getting an error here
($which abs)
打印,
alias abs='~/local/bin/abs'
~/local/bin/abs
batch_update_autobuilds.py源代码(错误来自何处)
abscommand = "abs update --test" // --test tag has been recently updated.
commandline = subprocess.Popen((abscommand))
output, error = commandline.communicate()
if error: <- error got caught here. //So it says no option available for --test.
问题:
commandline.communicate()
时,它调用了没有abs
选项的旧--test
。可能的解决方案(需要帮助):
abs
执行文件复制到~/local/bin
,并且我想强制python执行使用abs
中的~/local/bin
;在这种情况下,别名无效。