<?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 script commands in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814013#M829079</link>
    <description>&lt;BR /&gt;have a look at this thread, as I prefer Clay's method:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x459a8cc5e03fd6118fff0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x459a8cc5e03fd6118fff0090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Thu, 26 Sep 2002 11:33:44 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2002-09-26T11:33:44Z</dc:date>
    <item>
      <title>FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814012#M829078</link>
      <description>Hi group,&lt;BR /&gt;&lt;BR /&gt;I've used to be a VB-programmer but I recently switched jobs and now I'm a oracle developer.&lt;BR /&gt;I need to build a UNIX ftp script that gets or puts a certain file from/to a certain directory. I've got some sample scripts and I think I can copy/paste enough to get what I need. Problem is that I don't like code in my scripts that I don't fully understand.&lt;BR /&gt;&lt;BR /&gt;Can anybody give me some tips/ links to sites where I can get good information about the mentioned subject?&lt;BR /&gt;&lt;BR /&gt;script so far:&lt;BR /&gt;################&lt;BR /&gt;## Constants  ##&lt;BR /&gt;################&lt;BR /&gt;FILE=$1&lt;BR /&gt;SERVER=$2&lt;BR /&gt;USERNAME=$3&lt;BR /&gt;PASSWORD=$4&lt;BR /&gt;FTP_DIR=$5&lt;BR /&gt;#LOCAL=$6&lt;BR /&gt;#######################&lt;BR /&gt;# Validate Parameters #&lt;BR /&gt;#######################&lt;BR /&gt;if [ ! "$FILE" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Must Pass a FILE"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ ! "$SERVER" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Must Pass a SERVER name"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ ! "$FTP_DIR" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Must Pass a FTP Directory"&lt;BR /&gt;    exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ ! "$LOCAL" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Must Pass a LOCAL Directory"&lt;BR /&gt;    exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;########################&lt;BR /&gt;#       LOG            #&lt;BR /&gt;########################&lt;BR /&gt;LOG=/tmp/$1.log&lt;BR /&gt;&lt;BR /&gt;IP_ADDRESS=$2&lt;BR /&gt;USERNAME=$3&lt;BR /&gt;PASSWORD=$4&lt;BR /&gt;&lt;BR /&gt;########################&lt;BR /&gt;#Start Ftp and get file#&lt;BR /&gt;########################&lt;BR /&gt;ftp -nv ${SERVER} &amp;lt;&amp;lt; FTPEOF &amp;gt; /tmp/temp_log.$$&lt;BR /&gt;user ${USERNAME} ${PASSWORD}&lt;BR /&gt;#Get file&lt;BR /&gt;get $1&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;-------------------&lt;BR /&gt;I found (somewhere on the net) what ftp -nv means but what's going on with the &amp;lt;&lt;FTPEOF&gt; bladibladibla. It probably means that if the end of file is found put something in the log but how what why when?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;sander&lt;/FTPEOF&gt;</description>
      <pubDate>Thu, 26 Sep 2002 11:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814012#M829078</guid>
      <dc:creator>Sander Derix</dc:creator>
      <dc:date>2002-09-26T11:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814013#M829079</link>
      <description>&lt;BR /&gt;have a look at this thread, as I prefer Clay's method:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x459a8cc5e03fd6118fff0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x459a8cc5e03fd6118fff0090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 26 Sep 2002 11:33:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814013#M829079</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-26T11:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814014#M829080</link>
      <description>The "&amp;lt;&amp;lt; FTPEOF" is the start of a shell construct called a "here document". All of the lines following that one, up to a line with just "FTPEOF" on it, are included in the "here document". In this case, they are commands that will be fed to the ftp program as input.&lt;BR /&gt;&lt;BR /&gt;The other construct, "&amp;gt; /tmp/temp_log.$$", sends the ftp output into a file named "/tmp/temp_log.$$".&lt;BR /&gt;&lt;BR /&gt;Sounds like you need a good book/tutorial on shell programming. There are a number of shells: sh, csh, ksh, bash, ... I favor ksh, but you should ask your colleagues what they use - then you can always ask them for help, and they will be able to understand your scripts.&lt;BR /&gt;&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Sep 2002 11:53:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814014#M829080</guid>
      <dc:creator>Tom Maloy</dc:creator>
      <dc:date>2002-09-26T11:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814015#M829081</link>
      <description>As explained previously, it's a shell "here document".  I do not, however, see the EOF marker at the end of your post.  It should read:&lt;BR /&gt;&lt;BR /&gt;######################## &lt;BR /&gt;#Start Ftp and get file# &lt;BR /&gt;######################## &lt;BR /&gt;ftp -nv ${SERVER} &amp;lt;&amp;lt; FTPEOF &amp;gt; /tmp/temp_log.$$ &lt;BR /&gt;user ${USERNAME} ${PASSWORD} &lt;BR /&gt;#Get file &lt;BR /&gt;get $1 &lt;BR /&gt;quit &lt;BR /&gt;FTPEOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The "FTPEOF" which signifies the end of the here doc commands was missing.  Perhaps it's there but just wasn't in you post.&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Sep 2002 12:27:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814015#M829081</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2002-09-26T12:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814016#M829082</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;thnx for the replies!&lt;BR /&gt;&lt;BR /&gt;Tom you are correct I need a good book. But since programming these (simpel) scripts happens about 1 a year for us I was hoping that there where some good sites in wich this script programming is explained.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Sander</description>
      <pubDate>Fri, 27 Sep 2002 05:48:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814016#M829082</guid>
      <dc:creator>Sander Derix</dc:creator>
      <dc:date>2002-09-27T05:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814017#M829083</link>
      <description>You don't want the password as a commandline argument.&lt;BR /&gt;Anyone can do a ps -ef while it's running and see your password.&lt;BR /&gt;Either put it in the file like Sandip and Clay did in the link that was given,&lt;BR /&gt;or ask for it when the command is executed.&lt;BR /&gt;Ex:&lt;BR /&gt;echo "Enter Password: \c"&lt;BR /&gt;read password&lt;BR /&gt;&lt;BR /&gt;ftp -nv&lt;BR /&gt;open ftp.mysite.com&lt;BR /&gt;user $user&lt;BR /&gt;pass $password&lt;BR /&gt;......&lt;BR /&gt;..</description>
      <pubDate>Fri, 27 Sep 2002 11:05:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814017#M829083</guid>
      <dc:creator>Steve Faidley</dc:creator>
      <dc:date>2002-09-27T11:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: FTP script commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814018#M829084</link>
      <description>Sander,&lt;BR /&gt;&lt;BR /&gt;The construct you refer to is commonly called a 'here doc'.  What it means is that the text following the &amp;lt;&amp;lt; is redirected to stdin, as if you typed it on the keyboard.  The FTPEOF is the end marker.  Actually, there is an error in your code.  It should read as follows:&lt;BR /&gt;&lt;BR /&gt;ftp -nv ${SERVER} &amp;lt;&amp;lt; FTPEOF &amp;gt; /tmp/temp_log.$$ &lt;BR /&gt;user ${USERNAME} ${PASSWORD} &lt;BR /&gt;#Get file &lt;BR /&gt;get $1 &lt;BR /&gt;quit &lt;BR /&gt;FTPEOF&lt;BR /&gt;&lt;BR /&gt;Note the FTPEOF at the end of the file.  This tells the redirection to stop at that point.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Mark</description>
      <pubDate>Wed, 02 Oct 2002 15:18:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ftp-script-commands/m-p/2814018#M829084</guid>
      <dc:creator>Mark Ellzey</dc:creator>
      <dc:date>2002-10-02T15:18:09Z</dc:date>
    </item>
  </channel>
</rss>

