我想通過下面的字符串作爲輸入到shell腳本:傳遞字符串ant腳本
ant -f build.xml run -class_name="new_class" -arguments ="-n name -w default -print -o $1.txt"
我寫了如下一個shell腳本:
#!/bin/bash
"$1"
輸入:text.sh " ant -f build.xml run -class_name="new_class" -arguments ="-n name -w default -print -o $1.txt"
輸出:
ant command n ot found
我還將環境變量包含在shell腳本中。 但我的螞蟻腳本沒有輸入到我的shell腳本中。
saranyaa,但你是否考慮多個字符串作爲shell腳本的一個參數?通過編輯你想要達到什麼的問題,可以給出更多的上下文嗎? – Rao
'哪個螞蟻'的命令結果是什麼? 'echo $ CLASSPATH' – Rao
Hi Rao。我已經包含本地文件來讀取我的環境變量。 – saranyaa