You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jeff Lowery <je...@mavericklabel.com> on 2012/08/16 01:18:26 UTC
Re: Trying to execute 'grep'
Thanks. I think I've got it.
-- Jeff
On Aug 15, 2012, at 4:04 PM, Peter West wrote:
> It's not going through a shell, so "*.xml" is not being translated. Try execing sh with a -c arg containing the grep.
>
> Peter West
>
> "I am the bread of life; he who comes to me shall not hunger, and he who believes in me shall never thirst."
>
> On 16/08/2012, at 8:56 AM, Jeff Lowery <je...@mavericklabel.com> wrote:
>
>> Have the following target:
>>
>> <target name="test-failure-check">
>> <exec executable="grep">
>> <arg line="failure ${home.dir}/runtime/logs/test-results/*.xml" />
>> <redirector outputproperty="grep.out" />
>> </exec>
>> <echo message="grep.out='${grep.out}'" />
>>
>> <fail message="Unit test failure(s)">
>> <condition>
>> <not>
>> <equals arg1="${grep.out}" arg2="" />
>> </not>
>> </condition>
>> </fail>
>> </target>
>>
>> and getting the following echo:
>>
>> [echo] grep.out='grep: /Users/jeff.l/Documents/workspace/homedir/runtime/logs/test-results/*.xml: No such file or directory'
>>
>> yet if I execute "grep failure /Users/jeff.l/Documents/workspace/homedir/runtime/logs/test-results/*.xml", from the command line, I get results back.
>>
>>
>> -- Jeff
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>