ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Running <exec> task with an "interactive" executable
Date Fri, 12 Oct 2007 07:26:42 GMT
The input attribut passes the string to the invoked executable. In your case this is "cmd".
But not your "cmd" needs the passwort, the batchfile does. The cleanest way would be using
a
"-password" option of the batchfile (if it exist). 

Otherwise I would try piping inside the cmd ...

<arg line="${password} | batchfile..."/>



Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: terrance grahn [mailto:tjgrahn@gmail.com] 
>Gesendet: Mittwoch, 10. Oktober 2007 19:30
>An: user@ant.apache.org
>Betreff: Running <exec> task with an "interactive" executable
>
>I am trying to run an executable; however, I keep getting 
>stumped on one
>part.  I am able to run the executable correctly, but there is 
>a point in
>this executable that prompts the user for a password (and then 
>asks them to
>confirm it again).  I want to send this through the Ant task, 
>but nothing I
>use works.
>
>details:
>
>    <target name="createInstance" >
>
>        <!-- simple property to be used which will name the 
>instance (assume
>"instance1" is entered) -->
>        <input message="Enter the instance name"
>addproperty="instanceName"/>
>
>        <!-- calls the 'createinstance.bat' file and provides 
>the input from
>the arg line -->
>        <exec inputstring="password" dir="d:/oracle/OAS10g/bin"
>failonerror="true" executable="cmd" os="Windows XP">
>            <arg line="/C createinstance.bat -instanceName
>${instanceName}"/>
>
>        </exec>
>    </target>
>
>
>
>So this reads the arg line well, but it always errors out 
>because nothing is
>entered for the password.  Here is the output:
>
>Creating OC4J instance "instance1"...
>Set OC4J administrator password for "instance1" (password text 
>will not be
>displayed as it is entered):
>Error creating new OC4J instance: OC4J administrator's 
>password is null.
>
>
>
>I Guess I need to know exactly how 'input' and 'inputstring' 
>attributes can
>be used with the exec task - I have not seen any examples 
>anywhere that use
>these attributes.
>

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


Mime
View raw message