我想通过下面的字符串作为输入到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