我在運行ant時遇到了一些麻煩。這是我的問題的簡化版本。我有一個shell腳本script1.sh:ant:command not found
export ANT_HOME=/opt/Ant
ant -version
This works。但是當我嘗試創建另一個腳本SCRIPT2:
cd /location/of/script1
sudo -E ./script1.sh | tee log.txt
我得到的錯誤ant: command not found.
有誰知道爲什麼發生這種情況。
後你'CD /位置//script1',鍵入'這ant' –
你在同一個殼?你重新加載了shell嗎?導出是本地的shell(但你現在可能)。 –