<?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: Checking response file in a script (ksh) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918282#M108902</link>
    <description>This should be fairly easy...&lt;BR /&gt;&lt;BR /&gt;cd &lt;WHEREVER&gt;&lt;BR /&gt;# Don't ls *.PAY in case it exceeds the number&lt;BR /&gt;# of arguments for a command. If this is not&lt;BR /&gt;# the case then use ls *.PAY and remove the &lt;BR /&gt;# if statement checking if it's a .PAY file&lt;BR /&gt;ls | {&lt;BR /&gt;while read FNAME&lt;BR /&gt;do&lt;BR /&gt; if [[ ${FNAME} != *(?).PAY ]];&lt;BR /&gt; then continue&lt;BR /&gt; fi&lt;BR /&gt; PREFIX=${FNAME%.PAY} # Remove the .PAY suffix&lt;BR /&gt;&lt;BR /&gt; if [[ -f ${PREFIX}.CNF ]];&lt;BR /&gt; then continue&lt;BR /&gt; fi&lt;BR /&gt;&lt;BR /&gt;# Here we have a .PAY without a corresponding&lt;BR /&gt;# .CNF file.&lt;BR /&gt;&lt;BR /&gt; print "${FNAME} has no confirmation file!"&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/WHEREVER&gt;</description>
    <pubDate>Tue, 04 Mar 2003 13:16:57 GMT</pubDate>
    <dc:creator>John Palmer</dc:creator>
    <dc:date>2003-03-04T13:16:57Z</dc:date>
    <item>
      <title>Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918280#M108900</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I have a job that checks a file, creates a variable depending on the name of the file then renames the file once it has been sent. The problem I am having is checking the confirmation file that comes from the customer &lt;BR /&gt;&lt;BR /&gt;so&lt;BR /&gt;&lt;BR /&gt;DATE=$(date +%y%m%d)&lt;BR /&gt;CSVFILE=$(ls $DIR/$DATE[0-9][0-9].PAY | awk '{print $9}' | awk -F / '{print $6}' | cut -c1-8&lt;BR /&gt;&lt;BR /&gt;The above gives me&lt;BR /&gt;&lt;BR /&gt;03030401&lt;BR /&gt;&lt;BR /&gt;01 = first file to have been sent today. &lt;BR /&gt;&lt;BR /&gt;The problem I have is if I have to send more than one file in a day I will receive 2 response files, with a similar format as above&lt;BR /&gt;&lt;BR /&gt;for eg&lt;BR /&gt;&lt;BR /&gt;Yesterdays transfer failed. Today I am going to send&lt;BR /&gt;&lt;BR /&gt;03030301.PAY&lt;BR /&gt;&lt;BR /&gt;and Todays file&lt;BR /&gt;&lt;BR /&gt;03030401.PAY&lt;BR /&gt;&lt;BR /&gt;I should therefore receive from them.&lt;BR /&gt;&lt;BR /&gt;03030401.CNF&lt;BR /&gt;and&lt;BR /&gt;03030402.CNF&lt;BR /&gt;&lt;BR /&gt;Whats the best way to check that I have received the response files ? Bearing in mind the number of files that I have sent to them in a day and the file names I send will differ&lt;BR /&gt;&lt;BR /&gt;I am no great script writer&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Mar 2003 12:39:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918280#M108900</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2003-03-04T12:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918281#M108901</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;You have a .CNF  and a .PAY&lt;BR /&gt;&lt;BR /&gt;ls -1 ./|grep PAY$| while read line&lt;BR /&gt;do&lt;BR /&gt;field=$(echo $line|cut -f1 -d".")&lt;BR /&gt;  if [ -f $field".PAY" ] &amp;amp;&amp;amp; [ -f $field".CNF" ]&lt;BR /&gt;  then&lt;BR /&gt;  echo $field".CNF" found&lt;BR /&gt;  else&lt;BR /&gt;  echo wrong&lt;BR /&gt;  fi&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;ls -1 local directory and extract all .PAY&lt;BR /&gt;remove .PAY from name and in loop check&lt;BR /&gt;if .PAY and .CNF then ok else wrong.&lt;BR /&gt;&lt;BR /&gt;Fill in what you want to do&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;             Steve Steel</description>
      <pubDate>Tue, 04 Mar 2003 13:00:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918281#M108901</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-03-04T13:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918282#M108902</link>
      <description>This should be fairly easy...&lt;BR /&gt;&lt;BR /&gt;cd &lt;WHEREVER&gt;&lt;BR /&gt;# Don't ls *.PAY in case it exceeds the number&lt;BR /&gt;# of arguments for a command. If this is not&lt;BR /&gt;# the case then use ls *.PAY and remove the &lt;BR /&gt;# if statement checking if it's a .PAY file&lt;BR /&gt;ls | {&lt;BR /&gt;while read FNAME&lt;BR /&gt;do&lt;BR /&gt; if [[ ${FNAME} != *(?).PAY ]];&lt;BR /&gt; then continue&lt;BR /&gt; fi&lt;BR /&gt; PREFIX=${FNAME%.PAY} # Remove the .PAY suffix&lt;BR /&gt;&lt;BR /&gt; if [[ -f ${PREFIX}.CNF ]];&lt;BR /&gt; then continue&lt;BR /&gt; fi&lt;BR /&gt;&lt;BR /&gt;# Here we have a .PAY without a corresponding&lt;BR /&gt;# .CNF file.&lt;BR /&gt;&lt;BR /&gt; print "${FNAME} has no confirmation file!"&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/WHEREVER&gt;</description>
      <pubDate>Tue, 04 Mar 2003 13:16:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918282#M108902</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2003-03-04T13:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918283#M108903</link>
      <description>Hi Steven:&lt;BR /&gt;&lt;BR /&gt;Assuming the sent and the received files reside in the same directory, something like this would work:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;cd /tmp&lt;BR /&gt;for S in `ls [0-9][0-9]*.PAY`&lt;BR /&gt;do&lt;BR /&gt;  R=${S%%.PAY}.CNF&lt;BR /&gt;  ls ${R} &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;  if [ $? = 0 ]; then&lt;BR /&gt;    echo "${R} received"&lt;BR /&gt;  else&lt;BR /&gt;    echo "${R} not received"&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 04 Mar 2003 13:20:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918283#M108903</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-04T13:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918284#M108904</link>
      <description>Hi Steve&lt;BR /&gt;&lt;BR /&gt;You are checking for every .PAY that there is a .CNF of the same name. I have just found that the .PAY is renamed to .PAZ which isn't a problem. The .CNF files are moved to another area and renamed, could be a problem. &lt;BR /&gt;&lt;BR /&gt;For now though, there isn't necessarily a .PAZ with the same name ending .CNF&lt;BR /&gt;&lt;BR /&gt;I could have &lt;BR /&gt;&lt;BR /&gt;03030401.PAZ&lt;BR /&gt;&lt;BR /&gt;and receieve&lt;BR /&gt;&lt;BR /&gt;03030402.PAZ&lt;BR /&gt;&lt;BR /&gt;How do I check that ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 04 Mar 2003 13:20:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918284#M108904</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2003-03-04T13:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918285#M108905</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Initially I was trying to define the receive files from the files that I had sent&lt;BR /&gt;&lt;BR /&gt;CNFFILE=$( echo ${PAYPATH}/${CSVFILE} | /usr/bin/sed 's/\.PAY/\.CNF/g' | /usr/bin/awk -F / '{print $6}'  )&lt;BR /&gt;&lt;BR /&gt;But found I couldn't because they won't necessarily be the same&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Mar 2003 13:23:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918285#M108905</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2003-03-04T13:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918286#M108906</link>
      <description>Hi James&lt;BR /&gt;&lt;BR /&gt;Similar method to Steve, checking the name of the .PAY matches the .CNF.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 04 Mar 2003 13:25:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918286#M108906</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2003-03-04T13:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918287#M108907</link>
      <description>Sorry guys&lt;BR /&gt;&lt;BR /&gt;I'm confusing you. lets stick with the .PAY and .CNF&lt;BR /&gt;&lt;BR /&gt;I could have &lt;BR /&gt;&lt;BR /&gt;03030401.PAY &lt;BR /&gt;&lt;BR /&gt;and receieve &lt;BR /&gt;&lt;BR /&gt;03030402.CNF &lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 04 Mar 2003 13:28:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918287#M108907</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2003-03-04T13:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918288#M108908</link>
      <description>Your problem is difficult because there's no correlation between the name of the file that you send and the one that you receive.&lt;BR /&gt;&lt;BR /&gt;Is there anything in the actual data that could be used to identify which is which? Also, you say that 'Yesterdays transfer failed. Today I am going to send ...', do you get something back to say that it failed?&lt;BR /&gt;&lt;BR /&gt;Without some means of identification, the best you can hope to achieve is to flag up the fact that you haven't received confirmation for every file that you've sent.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Tue, 04 Mar 2003 13:41:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918288#M108908</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2003-03-04T13:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918289#M108909</link>
      <description>send ( )                                                                                                                            &lt;BR /&gt;{                                                                                                                                   &lt;BR /&gt;SEND_NUM=$1                                                                                                                         &lt;BR /&gt;                                                                                                                                    &lt;BR /&gt;DATE=$(date +%y%m%d)                                                                                                                &lt;BR /&gt;TDATE=$( TZ=CST-24 date +%y%m%d )                                                                                                   &lt;BR /&gt;echo " SENDED FILE ${DATE}${SEND_NUM}" &amp;gt;  ${DATE}${SEND_NUM}.PAY                                                                    &lt;BR /&gt;touch  ${TDATE}${SEND_NUM}.CNF                                                                                                      &lt;BR /&gt;touch  ${TDATE}${SEND_NUM}                                                                                                          &lt;BR /&gt;}                                                                                                                                   &lt;BR /&gt;                                                                                                                                    &lt;BR /&gt;check ( )                                                                                                                           &lt;BR /&gt;{                                                                                                                                   &lt;BR /&gt;CHECKDATE=$1                                                                                                                        &lt;BR /&gt;for i in $CHECKDATE[0-9][1-9]                                                                                                       &lt;BR /&gt;do                                                                                                                                  &lt;BR /&gt;        if  [ -s $i.CNF ] ; then                                                                                                    &lt;BR /&gt;                echo $i.PAY Have been recived                                                                                       &lt;BR /&gt;        else                                                                                                                        &lt;BR /&gt;                echo $i.PAY Have been not recived yet                                                                               &lt;BR /&gt;        fi                                                                                                                          &lt;BR /&gt;done                                                                                                                                &lt;BR /&gt;}                                                                                                                                   &lt;BR /&gt;                                                                                                                                    &lt;BR /&gt;send 01                                                                                                                             &lt;BR /&gt;send 02                                                                                                                             &lt;BR /&gt;check 030305                                                                                                                        &lt;BR /&gt;echo " CHANGIN SOME ONE "                                                                                                           &lt;BR /&gt;echo " RECIVED 03030502.CNF" &amp;gt;03030502.CNF                                                                                          &lt;BR /&gt;check 030305</description>
      <pubDate>Tue, 04 Mar 2003 13:57:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918289#M108909</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2003-03-04T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Checking response file in a script (ksh)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918290#M108910</link>
      <description>Hi Chaps&lt;BR /&gt;&lt;BR /&gt;I have found that a script spawned from this one has a task that removes the .CNF file. Therefore there is only ever on in the directory at any one time&lt;BR /&gt;&lt;BR /&gt;k ching&lt;BR /&gt;&lt;BR /&gt;Simple check then&lt;BR /&gt;&lt;BR /&gt;#       Now Check for the Response file&lt;BR /&gt;#&lt;BR /&gt;        CNFFILE=$(ls -ltr ${PAYPATH}/${DATE}[0-9][0-9].CNF | awk '{print $9}' | awk -F / '{print $6}')&lt;BR /&gt;        if [[  -f ${PAYPATH}/${CNFFILE} ]]&lt;BR /&gt;        then&lt;BR /&gt;            transferSuccess="YES"&lt;BR /&gt;        else&lt;BR /&gt;            logError "Payment confirmation file not received "&lt;BR /&gt;        fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for the input everyone&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 04 Mar 2003 15:05:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/checking-response-file-in-a-script-ksh/m-p/2918290#M108910</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2003-03-04T15:05:53Z</dc:date>
    </item>
  </channel>
</rss>

