<?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: scripting issue in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573150#M857524</link>
    <description>Hi (again) Ted:&lt;BR /&gt;&lt;BR /&gt;One more comment.  When analyzing ftp's replies, the format consists of a three-digit number, a space, some text, and an end-of-line.&lt;BR /&gt;&lt;BR /&gt;The numbers are standard.  The text will vary operating system to operating system.  Hence is is safer to parse and analyze the 3-digit number in the reply.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 30 Aug 2001 19:47:29 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2001-08-30T19:47:29Z</dc:date>
    <item>
      <title>scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573143#M857517</link>
      <description>embedded within a script I have the following:&lt;BR /&gt;&lt;BR /&gt;ftp server &amp;lt;</description>
      <pubDate>Thu, 30 Aug 2001 19:24:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573143#M857517</guid>
      <dc:creator>Ted Mims</dc:creator>
      <dc:date>2001-08-30T19:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573144#M857518</link>
      <description>&lt;BR /&gt;You could look at using tcl/tk to script the session, but it's a lot to learn if you have never used it before.</description>
      <pubDate>Thu, 30 Aug 2001 19:28:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573144#M857518</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-08-30T19:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573145#M857519</link>
      <description>Hi,&lt;BR /&gt;     I trap the return messages like this &lt;BR /&gt;&lt;BR /&gt;ret=`ftp -n -v 2&amp;gt;&amp;amp;1 &amp;lt;&amp;lt;- END&lt;BR /&gt;        open ${SERVER}&lt;BR /&gt;        user ${USER} ${PASSWORD}&lt;BR /&gt;        ${TYPE}&lt;BR /&gt;        lcd ${TO_DIR}&lt;BR /&gt;        cd ${FROM_DIR}&lt;BR /&gt;        get ${ORIGINAL_FILENAME} {NEW_FILENAME}&lt;BR /&gt;        bye&lt;BR /&gt;END`&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "incomplete"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "failed"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "No such"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "denied"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "refused"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "aborted"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;echo "$ret" | grep -q -i "cannot"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo "$ret" | grep -q -i "Not connected"&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "Ftp failed to get files"&lt;BR /&gt;        exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ashish Tripathi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 19:38:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573145#M857519</guid>
      <dc:creator>Ashish Tripathi</dc:creator>
      <dc:date>2001-08-30T19:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573146#M857520</link>
      <description>You could also do:&lt;BR /&gt;&lt;BR /&gt;yadda yadda yadda&lt;BR /&gt;put file&lt;BR /&gt;get file file.check&lt;BR /&gt;!&lt;BR /&gt;&lt;BR /&gt;diff file file.check&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;   error routine&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 19:39:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573146#M857520</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2001-08-30T19:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573147#M857521</link>
      <description>Try this work around&lt;BR /&gt;&lt;BR /&gt;ftp -v server &amp;lt;&amp;lt; EOF &amp;gt; /tmp/logfile 2&amp;gt;&amp;amp;1 &lt;BR /&gt;cd directory &lt;BR /&gt;put file &lt;BR /&gt;bye &lt;BR /&gt;EOF&lt;BR /&gt;grep "Not Connected" /tmp/logfile|grep -v grep&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Error on ftp"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;It should work.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 19:39:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573147#M857521</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-30T19:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573148#M857522</link>
      <description>If you don't mind the overhead, you could add to your script:&lt;BR /&gt;&lt;BR /&gt;get directory/file   /tmp/diditwork&lt;BR /&gt;&lt;BR /&gt;and then at the end of your script cksum the original and comapre that to the cksum of the temp file.</description>
      <pubDate>Thu, 30 Aug 2001 19:40:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573148#M857522</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-08-30T19:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573149#M857523</link>
      <description>Hi Ted:&lt;BR /&gt;&lt;BR /&gt;The 'ftp' session doesn't return an exit value denoting success or failure. &lt;BR /&gt;&lt;BR /&gt;If you really want to decipher success/failure you can parse the three-digit numbers included with the reply from each 'ftp' command.  Redirect the ftp session's verbose output into a logfile and parse the replies. The man pages (1M) for 'ftpd' [the daemon] discusss the reply format.  Essentially, the first digit of the message indicates whether the reply is good, bad, or incomplete.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Aug 2001 19:42:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573149#M857523</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-30T19:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: scripting issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573150#M857524</link>
      <description>Hi (again) Ted:&lt;BR /&gt;&lt;BR /&gt;One more comment.  When analyzing ftp's replies, the format consists of a three-digit number, a space, some text, and an end-of-line.&lt;BR /&gt;&lt;BR /&gt;The numbers are standard.  The text will vary operating system to operating system.  Hence is is safer to parse and analyze the 3-digit number in the reply.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Aug 2001 19:47:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue/m-p/2573150#M857524</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-30T19:47:29Z</dc:date>
    </item>
  </channel>
</rss>

