You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by gboysko <gb...@yahoo.com> on 2006/03/29 06:56:22 UTC

How to use stdin/stdout with exec

I am using Ant to automate the creation of some Java classes and compile
them. I also want to be able to execute one of these generated Java classes
(which has a builtin command processor). The commands are entered by the
user (interactively) and the output is sent back to the console (via
System.out).

I simply want to use either the JAVA or EXEC task to invoke the class, but I
can't get the stdin and stdout to be routed to the class. I can see lots of
ways to wire up the input/output to files, but no way to have them wired
back to the Ant console.  Am I missing something? Without specifying
anything, I don't see anything and can't enter anything.  Is there a way I
can specify the console/terminal in Windows using the input and output
attributes?

I am using Ant 1.6.5 on Windows.
--
View this message in context: http://www.nabble.com/How-to-use-stdin-stdout-with-exec-t1360004.html#a3643592
Sent from the Ant - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Urgent : Send me some Initial Docs

Posted by Jeffrey E Care <ca...@us.ibm.com>.
You might want to try reading the "Smart Questions" FAQ before posting to 
this list again.

http://www.catb.org/~esr/faqs/smart-questions.html
____________________________________________________________________________________________ 

Jeffrey E. (Jeff) Care 
carej@us.ibm.com 
IBM WebSphere Application Server Development 
WAS Pyxis Lead Release Engineer 




"Vipin Batra" <vb...@coulera.com> wrote on 03/28/2006 04:15:01 PM:

> Hello all !
> 
> I am a new user to the group. I wanna use ANT for automated testing (In
> Webservices). Please send me the Initial docs on ANT covering all the 
basics
> and Examples.
> I need to understand the use of ANT with examples so that I am able to
> bridge my project.
> Thanks in advance,
> 
> Vipin Batra.
> 
> ----- Original Message -----
> From: "gboysko" <gb...@yahoo.com>
> To: <us...@ant.apache.org>
> Sent: Wednesday, March 29, 2006 6:56 AM
> Subject: How to use stdin/stdout with exec
> 
> 
> >
> > I am using Ant to automate the creation of some Java classes and 
compile
> > them. I also want to be able to execute one of these generated Java
> classes
> > (which has a builtin command processor). The commands are entered by 
the
> > user (interactively) and the output is sent back to the console (via
> > System.out).
> >
> > I simply want to use either the JAVA or EXEC task to invoke the class, 
but
> I
> > can't get the stdin and stdout to be routed to the class. I can see 
lots
> of
> > ways to wire up the input/output to files, but no way to have them 
wired
> > back to the Ant console.  Am I missing something? Without specifying
> > anything, I don't see anything and can't enter anything.  Is there a 
way I
> > can specify the console/terminal in Windows using the input and output
> > attributes?
> >
> > I am using Ant 1.6.5 on Windows.
> > --
> > View this message in context:
> 
http://www.nabble.com/How-to-use-stdin-stdout-with-exec-t1360004.html#a36435
> 92
> > Sent from the Ant - Users forum at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.385 / Virus Database: 268.3.2/294 - Release Date: 
3/27/2006
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Urgent : Send me some Initial Docs

Posted by Vipin Batra <vb...@coulera.com>.
Hello all !

I am a new user to the group. I wanna use ANT for automated testing (In
Webservices). Please send me the Initial docs on ANT covering all the basics
and Examples.
I need to understand the use of ANT with examples so that I am able to
bridge my project.
Thanks in advance,

Vipin Batra.

----- Original Message -----
From: "gboysko" <gb...@yahoo.com>
To: <us...@ant.apache.org>
Sent: Wednesday, March 29, 2006 6:56 AM
Subject: How to use stdin/stdout with exec


>
> I am using Ant to automate the creation of some Java classes and compile
> them. I also want to be able to execute one of these generated Java
classes
> (which has a builtin command processor). The commands are entered by the
> user (interactively) and the output is sent back to the console (via
> System.out).
>
> I simply want to use either the JAVA or EXEC task to invoke the class, but
I
> can't get the stdin and stdout to be routed to the class. I can see lots
of
> ways to wire up the input/output to files, but no way to have them wired
> back to the Ant console.  Am I missing something? Without specifying
> anything, I don't see anything and can't enter anything.  Is there a way I
> can specify the console/terminal in Windows using the input and output
> attributes?
>
> I am using Ant 1.6.5 on Windows.
> --
> View this message in context:
http://www.nabble.com/How-to-use-stdin-stdout-with-exec-t1360004.html#a36435
92
> Sent from the Ant - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.3.2/294 - Release Date: 3/27/2006
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to use stdin/stdout with exec

Posted by toadFrog <ke...@comcast.net>.
I read through all the responses to your question. I saw nothing that
addressed this. 

Your question addresses an issue with is the same problem as running a KSH
interactive script from the ant exec command. Specifically, ant does not
block for user input when a script executes a read command  ,at least, 
using the following configuration:

ant build.xml snippet:

   <target name="promote" depends=""
      description="Usage: ant promote">
      <echo message="running: build-promote.sh"/>
     <exec
        dir="${clearance.dir}"
        spawn="false"
        executable="/bin/ksh">
        <arg line='-c "build-promote.sh &lt; $STDIN"'/>
     </exec>
   </target>


ksh: build-promote.sh  snippet:

echo
echo "Select kit number: "
typeset -i akit
read aKit
echo "Is this kit number ok? $aKit" 

Upon execution of the read command, ant must stop and allow the user to
enter a response.  Instead what is happening is execution continues with the
next line in the shell pgm. I can't enter a response to any of the reads in
the pgm.

Seems this is just operator error on our part. But, I've messed around with
this too long and tried several different approaches.

Were you able to get this working?

thx in advance. kev.



gboysko wrote:
> 
> I am using Ant to automate the creation of some Java classes and compile
> them. I also want to be able to execute one of these generated Java
> classes (which has a builtin command processor). The commands are entered
> by the user (interactively) and the output is sent back to the console
> (via System.out).
> 
> I simply want to use either the JAVA or EXEC task to invoke the class, but
> I can't get the stdin and stdout to be routed to the class. I can see lots
> of ways to wire up the input/output to files, but no way to have them
> wired back to the Ant console.  Am I missing something? Without specifying
> anything, I don't see anything and can't enter anything.  Is there a way I
> can specify the console/terminal in Windows using the input and output
> attributes?
> 
> I am using Ant 1.6.5 on Windows.
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-stdin-stdout-with-exec-tp3643592p17153242.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org