ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhendi Su <rachael...@oracle.com>
Subject Re: error running <exec> task
Date Wed, 06 Feb 2002 17:49:21 GMT
I got rid of the "*" and it still didn't work...

I've tried two ways:

<exec executable="ls" failonerror="True">
<arg value="-l" />
</exec>

and

<exec executable="/usr/bin/ls" failonerror="True">
<arg value="-l" />
</exec>

I am using /urs/bin/ls because when I ask UNIX "whereis ls" it gave me
ls: /usr/bin/ls /usr/ucb/ls /usr/man/man1/ls.1 /usr/man/man1b/ls.1b

The error message is the same as before (in both cases):

[exec] Current OS is SunOS
     [exec] /usr/bin/ls -l

BUILD FAILED

/home/rsu/prototype/exec.xml:19: exec returned: -1
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java,
Compiled Code)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java,
Compiled Code)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java,
Compiled Code)
        at org.apache.tools.ant.Task.perform(Task.java, Compiled Code)
        at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
        at org.apache.tools.ant.Target.performTasks(Target.java, Compiled Code)

        at org.apache.tools.ant.Project.executeTarget(Project.java, Compiled
Code)
        at org.apache.tools.ant.Project.executeTargets(Project.java, Compiled
Code)
        at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
        at org.apache.tools.ant.Main.start(Main.java, Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java, Compiled Code)

Is there something that I am missing here?

Thanks a lot!

Zhendi

Conor MacNeill wrote:

> > From: Diane Holt [mailto:holtdl@yahoo.com]
> >
> > Get rid of the "*" -- you don't need it, since 'ls -l' will list
> > everything anyway, and including an asterisk in the command line doesn't
> > work unless you exec 'sh' instead of 'ls'.
> >
>
> Just to expand a bit on Diane's explanation. On Unix systems, the shell is
> responsible for wildcard expansion, not the individual commands. when you
> pass "*" in Ant, the shell is not involved and the command receives the "*"
> char directly rather than a list of files.
>
> Conor
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message