You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by An...@mn.man.de on 2001/09/11 13:08:43 UTC

Telnet Task - how to work with variables in write commands

I tried to use properties in telnet write - tags,
but the properties don't get replaced before execution.

f.e.
     <telnet
          server="${deployment.server}"
          initialCR="YES">
       <read>ogin:</read>
       <write>wasadm</write>
       <write>was#9436</write>
       <read>ome/wasadm</read>
       ...

       <read>ome/wasadm</read>
       <write>cd projects/${ant.projekt.name}</write>

       <write>exit</write>
       <read>logout</read>
     </telnet>

I also recognized that working with <env> tags is not
possible in telnet tasks.

f.e.
       <env>export ANT_PROJEKT=${ant.projekt.name}</env>
       <write>cd projects</write>
       <write>cd $ANT_PROJEKT</write>

Is there any possibility to work with variables in telnet tags?

Any help is very much appreciated.

thanks in advance

A. Grimm

****************************************************
MAN Nutzfahrzeuge AG
Anton Grimm
Abt. IDP (SoftwareProduktionsumgebungen)
Dachauerstr.667
80995 München

Tel.:      089/1580-1054
Fax:      089/1580-911054
E-Mail: Anton_Grimm@mn.man.de
****************************************************


Re: Telnet Task - how to work with variables in write commands

Posted by James Bullington <sh...@yahoo.com>.
I am able to do the following in a write command:

<read>login:</read>
<write string="${username}"/>

I am using ant 1.3.  Are you sure that optional.jar
and NetComponents.jar are in your CLASSPATH?
i.e.
CLASSPATH=c:\ant\lib\optional.jar;c:\ant\lib\NetComponents.jar;%CLASSPATH%

I have not tried to name the server as a variable, 
but the username and password are passed in as
variables (i.e. -Dusername=jim)

Hope this helps, or at least provides a clue.
--Jim

--- Anton_Grimm@mn.man.de wrote:
> I tried to use properties in telnet write - tags,
> but the properties don't get replaced before
> execution.
> 
> f.e.
>      <telnet
>           server="${deployment.server}"
>           initialCR="YES">
>        <read>ogin:</read>
>        <write>wasadm</write>
>        <write>was#9436</write>
>        <read>ome/wasadm</read>
>        ...
> 
>        <read>ome/wasadm</read>
>        <write>cd
> projects/${ant.projekt.name}</write>
> 
>        <write>exit</write>
>        <read>logout</read>
>      </telnet>
> 
> I also recognized that working with <env> tags is
> not
> possible in telnet tasks.
> 
> f.e.
>        <env>export
> ANT_PROJEKT=${ant.projekt.name}</env>
>        <write>cd projects</write>
>        <write>cd $ANT_PROJEKT</write>
> 
> Is there any possibility to work with variables in
> telnet tags?
> 
> Any help is very much appreciated.
> 
> thanks in advance
> 
> A. Grimm
> 
> ****************************************************
> MAN Nutzfahrzeuge AG
> Anton Grimm
> Abt. IDP (SoftwareProduktionsumgebungen)
> Dachauerstr.667
> 80995 M�nchen
> 
> Tel.:      089/1580-1054
> Fax:      089/1580-911054
> E-Mail: Anton_Grimm@mn.man.de
> ****************************************************
> 


=====
Support anti-Spam legislation.
Join the fight http://www.cauce.org/

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com