telnetting without a telnet module

Discussion in 'Perl' started by Howard, Nov 7, 2003.

  1. Howard

    Howard Guest

    Hello everyone,
    i was wondering if anybody knew how to "telnet" to another machine
    to get a file, but the machine that i am using and the machine i am
    targetting both do not have the telnet module. Thanks


    Howard
     
    Howard, Nov 7, 2003
    #1
    1. Advertising

  2. Howard

    Jane Gaddal Guest

    Use HTTP Post


    "Howard" <> wrote in message
    news:...
    > Hello everyone,
    > i was wondering if anybody knew how to "telnet" to another machine
    > to get a file, but the machine that i am using and the machine i am
    > targetting both do not have the telnet module. Thanks
    >
    >
    > Howard
     
    Jane Gaddal, Nov 14, 2003
    #2
    1. Advertising

  3. Howard

    GIMME Guest

    Why don't you run Perl from ANT and then have ANT handle the ftp task
    ?

    ANT will allow you to telnet to a remote host and to execute an
    ftp from there to yet another remote host. So you can get around
    a firewall.

    Something like ...

    <project name="Manifest" basedir="." default="Doc" >

    <property file="${JobName}/job.properties"/>
    <property name="JobOrderOutput" value="${JobOrderRoot}/job_output"/>
    <property name="Perl" value="/usr/local/bin/perl"/>
    <property name="JobOrderPerl" value="${JobOrderRoot}/perl"/>
    <property name="JobOrderPerlLib" value="${JobOrderRoot}/lib"/>

    <target name="RunPerl">
    <echo message="exc : ${Perl} -I${JobOrderPerlLib}
    ${JobOrderPerl}/${JobScript} ${JobOrderOutput} ${JobOrderArgs}"/>
    <exec executable="${Perl}">
    <arg line="-I${JobOrderPerlLib}"/>
    <arg line="${JobOrderPerl}/${JobScript}"/>
    <arg line="${JobOrderOutput}"/>
    </exec>
    </target>


    <target name="FtpToStaging">
    <echo message="ftp : ${FTPServer} as ${FTPUserID}/${FTPPassword}"/>
    <echo message="lcd : ${JobOrderOutput}"/>
    <echo message="put : ${JobOrderOutputFileName}"/>
    <ftp server="${FTPServer}"
    remotedir="${FTPRemoteDir}"
    userid="${FTPUserID}"
    password="${FTPPassword}"
    >

    <fileset dir="${JobOrderOutput}">
    <include name="${JobOrderOutputFileName}"/>
    </fileset>
    </ftp>
    </target>


    <target name="StagingPushToRemote">
    <telnet userid="${TNPStageUserID}"
    password="${TNPStagePassword}"
    server="${TNPStageServer}"
    >

    <read string="${TNPStagePrompt}"/>
    <write string="ftp ${TNPExternalHost}"/>
    <read>):</read>
    <write string="${TNPExternalHostUserID}"/>
    <read>:</read>
    <write string="${TNPExternalHostPassword}"/>
    <read>ftp></read>
    <write string="binary"/>
    <read>ftp></read>
    <write string="${TNPExecuteLCD}"/>
    <read>ftp></read>
    <write string="${TNPExecuteCD}"/>
    <read>ftp></read>
    <write string="${TNPExecutePush}"/>
    <read>ftp></read>
    <write>quit</write>
    </telnet>
    </target>

    <target name="MainTarget" >
    <antcall target="RunPerl"/>
    <antcall target="FtpToStaging"/>
    <antcall target="StagingPushToRemote"/>
    </target>

    </project>
     
    GIMME, Nov 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Isaacson
    Replies:
    5
    Views:
    628
    Default User
    Nov 5, 2004
  2. ashu.deshpande
    Replies:
    0
    Views:
    482
    ashu.deshpande
    Jun 24, 2008
  3. tukker
    Replies:
    2
    Views:
    512
    Tom Anderson
    Apr 27, 2010
  4. Peña, Botp

    telnetting cisco routers/devices

    Peña, Botp, Jul 4, 2005, in forum: Ruby
    Replies:
    2
    Views:
    145
    Ghislain Mary
    Jul 4, 2005
  5. Carcarius
    Replies:
    0
    Views:
    328
    Carcarius
    Dec 6, 2007
Loading...

Share This Page