ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <>
Subject Re: Exec task in Ant 1.6.1
Date Wed, 14 Apr 2004 17:20:53 GMT
--- Rhino <> wrote:
> That was definitely an intriguing idea but it didn't
> work. It launched a DB2
> command window but didn't execute either of the
> commands in the inputstring.
> I checked the comment on the procedure afterwards
> and it hadn't changed to
> the new value. I tried adding an
> output="db2cmd3.txt" but nothing at all was
> written to it.
> > You could also use a real line in the buildfile to
> > signify the line break in the inputstring
> attribute,
> > OR put the whole thing as two lines in a file and
> use
> > that on the input attribute.  I'd try this general
> > approach first; you may get lucky.
> Could you clarify both of these approaches please? I
> don't have a clear idea
> of what you mean by either one.

Here I meant the general approach of sending input to
the executable.  The other things were different ways
of specifying the input source (input vs. inputstring)
and breaking the two commands, e.g.
"foo${line.separator}bar${line.separator}" vs. "foo
" (I only now realized that with this approach you'd
probably still need an ending line break).  But it
seems that this isn't working....

However, it just so happens I have an installation of
db2 on my Win2K box so I have been playing around with
it.  Are you sure you need db2cmd?  It doesn't seem to
do a whole hell of a lot, other than spawning off some
windows and generally making it hard to do anything
automated.  Try the approach above using the db2
executable, so that db2 is treated as an interactive
executable.  You may be pleasantly surprised.

For example, I created a file db2input that contained
the text:

list active databases

and from a plain CMD window I entered:

db2 <db2input

This seemed to work and can be mimicked this way:

<exec executable="db2" input="db2input" />

Although personally I avoid external files like the
plague and would probably use the ${line.separator}
property to delimit lines in the inputstring

Now that we have degenerated this into a db2
discussion instead of an Ant discussion... ;)


Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message