<?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: how to get output of an ftp command into a variable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742778#M656002</link>
    <description>&lt;P&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;In a reply I made in your previous thread, I wrote, "You could use something like 'dir' to collect a listing (with dates) of the files in a directory and then parse that list, though."&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/System-Administration/Download-files-to-local-server-using-ftp-script-based-on-date/m-p/4735316#M386809" target="_blank"&gt;http://h30499.www3.hp.com/t5/System-Administration/Download-files-to-local-server-using-ftp-script-based-on-date/m-p/4735316#M386809&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Since you are redirecting your FTP session output to a file (${LOG}) you can parse ('grep', 'awk', 'perl') that after the FTP session ends and thus deliver the information you want to the encapsulating script. I would think that this should include the response from 'modtime'. If so, you will need to parse it out of the ${LOG} output.&lt;BR /&gt;&lt;BR /&gt;I don't see the value of using 'message1' to collect information.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2011 19:25:27 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2011-08-08T19:25:27Z</dc:date>
    <item>
      <title>how to get output of an ftp command into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742776#M656000</link>
      <description>Hi I am using the below command for getting the files from remote server using ftp.&lt;BR /&gt;message1=`ftp -i -n -v ${server} &amp;gt;&amp;gt; $LOG &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;   user $USERNAME $PASSWORD&lt;BR /&gt;   ascii&lt;BR /&gt;   umask 022&lt;BR /&gt;        cd $FROM_DIRECTORY&lt;BR /&gt;      lcd $TO_DIRECTORY/$dt_stamp_yday&lt;BR /&gt;        ls&lt;BR /&gt;      mget *.txt&lt;BR /&gt;   bye&lt;BR /&gt;   EOF`&lt;BR /&gt;&lt;BR /&gt;It is running successfully. But now I want to download the files based on time. &lt;BR /&gt;&lt;BR /&gt;JRF (Forum member) suggested modtime command  to get the modified time of remote file. &lt;BR /&gt;&lt;BR /&gt;Now my question is I want to take output of modtime command to a variable so that I can refer that variable in the script.&lt;BR /&gt;&lt;BR /&gt;Please tell me how can I do that.</description>
      <pubDate>Mon, 24 Jan 2011 08:37:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742776#M656000</guid>
      <dc:creator>Gopi Kishore m</dc:creator>
      <dc:date>2011-01-24T08:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to get output of an ftp command into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742777#M656001</link>
      <description>&amp;gt;I want to take output of modtime command to a variable so that I can refer that variable in the script.&lt;BR /&gt;&lt;BR /&gt;You can get the output of ls into a file:&lt;BR /&gt;ls [remote-directory] [local-file]&lt;BR /&gt;&lt;BR /&gt;modtime doesn't seem to be able to redirect the output.  With your above message1=$(ftp ...) you can capture that output and the parse it.</description>
      <pubDate>Mon, 24 Jan 2011 11:25:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742777#M656001</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-01-24T11:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to get output of an ftp command into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742778#M656002</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;In a reply I made in your previous thread, I wrote, "You could use something like 'dir' to collect a listing (with dates) of the files in a directory and then parse that list, though."&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/System-Administration/Download-files-to-local-server-using-ftp-script-based-on-date/m-p/4735316#M386809" target="_blank"&gt;http://h30499.www3.hp.com/t5/System-Administration/Download-files-to-local-server-using-ftp-script-based-on-date/m-p/4735316#M386809&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Since you are redirecting your FTP session output to a file (${LOG}) you can parse ('grep', 'awk', 'perl') that after the FTP session ends and thus deliver the information you want to the encapsulating script. I would think that this should include the response from 'modtime'. If so, you will need to parse it out of the ${LOG} output.&lt;BR /&gt;&lt;BR /&gt;I don't see the value of using 'message1' to collect information.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2011 19:25:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742778#M656002</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-08-08T19:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to get output of an ftp command into a variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742779#M656003</link>
      <description>ThanQ James and Dennis,&lt;BR /&gt;&lt;BR /&gt;I will do the parsing.&lt;BR /&gt;&lt;BR /&gt;Actually I am searching for a way to directly get the output of ftp command like dir,pwd into a variable.&lt;BR /&gt;&lt;BR /&gt;It seems there is no direct way other than parsing.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jan 2011 13:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-output-of-an-ftp-command-into-a-variable/m-p/4742779#M656003</guid>
      <dc:creator>Gopi Kishore m</dc:creator>
      <dc:date>2011-01-24T13:53:21Z</dc:date>
    </item>
  </channel>
</rss>

