6
我有一个Ant脚本走在inputed密码后运行一个标准-task:传递输入到Ant的<exec>任务
<input message="Password:" addproperty="password">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<exec executable="/bin/sh" input="${password}" failonerror="true">
<arg line='-c "myScript.sh"' />
</exec>
脚本myScript.sh提示用户输入密码,并且,这是我的理解是从Ant文件是输入应该继电器输入无论<exec>
任务执行,而是我得到(用于输入密码foobar的)
[exec] Failed to open /usr/local/foobar
随后是一个堆叠T从我的脚本中抱怨一个不正确的密码...显然我已经理解了文档错误。有谁知道如何处理来自Ant中外部脚本的提示输入吗?
谢谢,似乎至少已经解决了主要问题! – mikek 2010-05-06 15:59:49
让我强调在元素中使用'-c'/ your/command''的重要性,并将元素的“可执行”属性设置为“/ bin/sh”。 –
2011-07-18 09:26:47