<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FTP in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600832#M855630</link>
    <description>Try this .. &lt;BR /&gt;&lt;BR /&gt;To get&lt;BR /&gt;======&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;[[ $# != 5 ]] &amp;amp;&amp;amp; { echo "Usage: $0 &lt;LOGIN&gt; &lt;PASSWORD&gt; &lt;SOURCE&gt; &lt;FILENAME&gt; &lt;REMOTE_DIR&gt;"; exit 1; }&lt;BR /&gt;{ echo user $1 $2; echo cd $5; echo mget $4; echo quit; } | ftp -i -n $3&lt;BR /&gt;&lt;BR /&gt;To put&lt;BR /&gt;======&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;[[ $# != 5 ]] &amp;amp;&amp;amp; { echo "Usage: $0 &lt;LOGIN&gt; &lt;PASSWORD&gt; &lt;TARGET&gt; &lt;FILENAME&gt; &lt;DEST_DIR&gt;"; exit; }&lt;BR /&gt;{ echo user $1 $2; echo cd $5; echo mput $4; echo quit; } | ftp -i -n $3&lt;BR /&gt;&lt;/DEST_DIR&gt;&lt;/FILENAME&gt;&lt;/TARGET&gt;&lt;/PASSWORD&gt;&lt;/LOGIN&gt;&lt;/REMOTE_DIR&gt;&lt;/FILENAME&gt;&lt;/SOURCE&gt;&lt;/PASSWORD&gt;&lt;/LOGIN&gt;</description>
    <pubDate>Wed, 24 Oct 2001 21:10:39 GMT</pubDate>
    <dc:creator>S.K. Chan</dc:creator>
    <dc:date>2001-10-24T21:10:39Z</dc:date>
    <item>
      <title>FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600828#M855626</link>
      <description>I am trying to write a script to ftp/put a file to another server.&lt;BR /&gt;&lt;BR /&gt;script 1&lt;BR /&gt;  ftp -i my_server&lt;BR /&gt;  user my_id my_password&lt;BR /&gt;  cd /target_dir&lt;BR /&gt;  put my_file&lt;BR /&gt;  quit&lt;BR /&gt;&lt;BR /&gt;script 2&lt;BR /&gt;  ( echo open my_server&lt;BR /&gt;  sleep 1&lt;BR /&gt;  echo my_id&lt;BR /&gt;  sleep 1&lt;BR /&gt;  echo my_password&lt;BR /&gt;  sleep 1&lt;BR /&gt;  echo "cd /target_dir"&lt;BR /&gt;  sleep 1&lt;BR /&gt;  ehco "put my_file"&lt;BR /&gt;  sleep 1&lt;BR /&gt;  echo quit&lt;BR /&gt;  ) | ftp&lt;BR /&gt;&lt;BR /&gt;Both of these seem to hang at the ftp login.  Then when I ctrl-c, they continue with errors.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks, Ron</description>
      <pubDate>Wed, 24 Oct 2001 20:54:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600828#M855626</guid>
      <dc:creator>Ron Bell</dc:creator>
      <dc:date>2001-10-24T20:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600829#M855627</link>
      <description>Hi Ron:&lt;BR /&gt;&lt;BR /&gt;In the past, I did this stuff in the shell but now I tend to use Perl because it it so much cleaner.&lt;BR /&gt;&lt;BR /&gt;When I have to do ftp scripting these days, I use perl with the Net::FTP module (available for download at &lt;A href="http://www.perl.org/CPAN)." target="_blank"&gt;www.perl.org/CPAN).&lt;/A&gt; It really makes FTP operations very simple. Any error conditions and timeouts are easy to test for and set. &lt;BR /&gt;&lt;BR /&gt;It's usually something as simple as this (with error checking omitted): &lt;BR /&gt;&lt;BR /&gt;use Net::FTP; &lt;BR /&gt;&lt;BR /&gt;$ftp = Net::FTP-&amp;gt;new("remotehost.name", Debug =&amp;gt; 0); &lt;BR /&gt;$ftp-&amp;gt;login("anonymous",'cstephen@xyz.com'); &lt;BR /&gt;$ftp-&amp;gt;cwd("/downloads"); &lt;BR /&gt;$ftp-&amp;gt;get("Testfile.TXT"); &lt;BR /&gt;$ftp-&amp;gt;quit; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As a bonus this works in the wonderful world of Windows as well. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Wed, 24 Oct 2001 21:05:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600829#M855627</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-10-24T21:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600830#M855628</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;script 1 will start ftp and then the script will hang until you leave ftp.  Then it will try user, cd, put &amp;amp; quit on the command line.&lt;BR /&gt;&lt;BR /&gt;try:&lt;BR /&gt;&lt;BR /&gt;ftp -n my_server &amp;lt;&amp;lt; [EOT]&lt;BR /&gt;user my_id my_passwd&lt;BR /&gt;cd /target&lt;BR /&gt;put my_file&lt;BR /&gt;bye&lt;BR /&gt;[EOT]&lt;BR /&gt;&lt;BR /&gt;Mind to put [EOT] solely on a line, don't add any character or space!&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
      <pubDate>Wed, 24 Oct 2001 21:08:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600830#M855628</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2001-10-24T21:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600831#M855629</link>
      <description>Hi Ron:&lt;BR /&gt;&lt;BR /&gt;Here are two ways to do this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;ftp -n &amp;lt;&amp;lt; EOF &lt;BR /&gt;verbose &lt;BR /&gt;open thehost &lt;BR /&gt;user uuu ppp &lt;BR /&gt;get /tmp/stuff &lt;BR /&gt;close &lt;BR /&gt;EOF &lt;BR /&gt;&lt;BR /&gt;... &lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;{ echo "open thehost &lt;BR /&gt;user uuu ppp &lt;BR /&gt;hash &lt;BR /&gt;mput * &lt;BR /&gt;close" &lt;BR /&gt;} | ftp -i -n -v 2&amp;gt;&amp;amp;1 | tee /tmp/ftplog.$$ &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 24 Oct 2001 21:10:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600831#M855629</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-10-24T21:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600832#M855630</link>
      <description>Try this .. &lt;BR /&gt;&lt;BR /&gt;To get&lt;BR /&gt;======&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;[[ $# != 5 ]] &amp;amp;&amp;amp; { echo "Usage: $0 &lt;LOGIN&gt; &lt;PASSWORD&gt; &lt;SOURCE&gt; &lt;FILENAME&gt; &lt;REMOTE_DIR&gt;"; exit 1; }&lt;BR /&gt;{ echo user $1 $2; echo cd $5; echo mget $4; echo quit; } | ftp -i -n $3&lt;BR /&gt;&lt;BR /&gt;To put&lt;BR /&gt;======&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;[[ $# != 5 ]] &amp;amp;&amp;amp; { echo "Usage: $0 &lt;LOGIN&gt; &lt;PASSWORD&gt; &lt;TARGET&gt; &lt;FILENAME&gt; &lt;DEST_DIR&gt;"; exit; }&lt;BR /&gt;{ echo user $1 $2; echo cd $5; echo mput $4; echo quit; } | ftp -i -n $3&lt;BR /&gt;&lt;/DEST_DIR&gt;&lt;/FILENAME&gt;&lt;/TARGET&gt;&lt;/PASSWORD&gt;&lt;/LOGIN&gt;&lt;/REMOTE_DIR&gt;&lt;/FILENAME&gt;&lt;/SOURCE&gt;&lt;/PASSWORD&gt;&lt;/LOGIN&gt;</description>
      <pubDate>Wed, 24 Oct 2001 21:10:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600832#M855630</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2001-10-24T21:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600833#M855631</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;That is the best solution todate! I love it!&lt;BR /&gt; &lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;&lt;BR /&gt;harry</description>
      <pubDate>Wed, 24 Oct 2001 21:14:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600833#M855631</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-10-24T21:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600834#M855632</link>
      <description>Thank you Thierry!  I just needed a quick fix and you were right on.&lt;BR /&gt;&lt;BR /&gt;Thanks also to everyone else.  I will try out some of the other solutions, especially the perl one.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ron</description>
      <pubDate>Wed, 24 Oct 2001 21:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp/m-p/2600834#M855632</guid>
      <dc:creator>Ron Bell</dc:creator>
      <dc:date>2001-10-24T21:38:32Z</dc:date>
    </item>
  </channel>
</rss>

