You might be able to generate a file and use the 'input' attribute of
<exec>, with each command on a separate line in the input file. This does
not allow you to parse any output or wait for results, but if the program
isn't reading from STDIN each time until its next prompt, this should work.

-Andrew

On 3/5/06, Shay Thompson <[EMAIL PROTECTED]> wrote:
>
>
> :) sorry, wasn't trying to be confusing.
>
> The program I'm using is the WebLogic console program called WLST.  It's
> basically a shell program for WebLogic which allows you to do things
> like deploy and undeploy applications.  An example use is to start the
> program, log in, enter edit mode, deploy an application, save and then
> exit.  After each command I need to parse the output to verify the step
> was successful before writing the next command.
>
> Using Telnet to connect to a remote machine, or the local one for that
> matter, allows me to do this because the Telnet task allows for multiple
> read/writes in a single runtime where the <exec> task only allows for 1
> write and the 1 read which is the end result.
>
> This script is used for testing on multiple machines, some of which it
> will be run on locally, and I'd prefer not to have to tell everyone that
> uses it that they have to turn on a telnet server just to run it
> locally.  For now, Windows is the only OS I'm concerned about.  We are
> using Ant 1.6.3 and some version of the contrib library.
>
> Thanks,
> Shay
>
> Rhino wrote:
> > I've just reread your question for the third time and I still don't
> > think I get it. It sounds to me like you are "talking around" the
> > problem, not describing the actual problem.
> >
> > What exactly are you trying to do? You're talking about needing
> > "multiple reads and writes" but I haven't a clue WHAT you are trying
> > to read or write.
> >
> > What specific command-line program are you trying to use here? Why
> > does your solution for remote machines not work for local machines?
> >
> > And what's wrong with the telnet solution you describe if it gets the
> > job done? Is it just not elegant enough? It's perfectly valid to find
> > a more elegant solution if the one you have is clunky; I'm just trying
> > to figure out if the existing solution works at all or if you in big
> > trouble because you can't get something to work at all, even badly.
> >
> > What operating system are you on and which Ant version are you using?
> > That can make a difference to the answer sometimes.
> >
> > --
> > Rhino
> >
> > ----- Original Message ----- From: "Shay Thompson" <[EMAIL PROTECTED]>
> > To: <user@ant.apache.org>
> > Sent: Sunday, March 05, 2006 6:13 PM
> > Subject: Looking for an Ant Task
> >
> >
> >>
> >> I'm trying to find an Ant task that will let me work with a
> command-line
> >> program with multiple read/writes.
> >>
> >> The problem I've run into is how to communicate with this program
> >> locally.  For remote servers, I can use the <telnet> Ant task to telnet
> >> to the remote machine, start up the and send the commands.  Locally,
> >> there's no Ant task that I know of which can do *multiple *reads and
> >> writes to a program/shell/console.
> >>
> >> The only solution I've found so far is to actually telnet into the
> local
> >> machine, which allows me to use the <telnet> Ant task.
> >>
> >> An example of what I mean:
> >>
> >> <read>myprompt:</read>
> >> <write>dosomething</write>
> >> <read>Response from dosomething</read>
> >> <write>dosomething2</write>
> >> <read>Response from dosomething2</read>
> >>
> >> Thanks,
> >> Shay
> >>
> >>
> >> --
> >>
> >> ... hey, it works on my machine.
> >>
> >> Shay Thompson - Lead Computer Scientist
> >> Adobe Systems, Inc. - Titan Core QE
> >> Voice: x34728 or 612.251.5415
> >>
> >>
> >
> >
> >
> --------------------------------------------------------------------------------
> >
> >
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.375 / Virus Database: 268.1.2/274 - Release Date:
> 03/03/2006
> >
> >
> >
>
> --
>
> ... hey, it works on my machine.
>
> Shay Thompson - Lead Computer Scientist
> Adobe Systems, Inc. - Titan Core QE
> Voice: x34728 or 612.251.5415
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to