<?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: I need help to write a script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566411#M30023</link>
    <description>Reynaldo,&lt;BR /&gt;&lt;BR /&gt;Do we need to extract the information from Oracle tables or is already there in the output files?&lt;BR /&gt;&lt;BR /&gt;Do we have to send mail to the buyer that is there in the output file?&lt;BR /&gt;&lt;BR /&gt;Your message is not clear. Please explain in detail.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
    <pubDate>Fri, 17 Aug 2001 02:29:22 GMT</pubDate>
    <dc:creator>Sridhar Bhaskarla</dc:creator>
    <dc:date>2001-08-17T02:29:22Z</dc:date>
    <item>
      <title>I need help to write a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566410#M30022</link>
      <description>Please can someone help me to write a script to send mail from some oracle parameters for example.&lt;BR /&gt;&lt;BR /&gt;EFILE=         "Is the file or out put report"&lt;BR /&gt;BUYER_EMAIL=   "The person I need to send the report" &lt;BR /&gt;VENDOR_EMAIL=  "The e-mail address from the vendor"&lt;BR /&gt;PO_NUMBER=     "The Purchase Order Number"&lt;BR /&gt;&lt;BR /&gt;These are parameteres set in oracle so when the buyer enter the information in oracle a report gets generated, and once the report is generated resides in the output report writer in UNIX so I want to write a script to be able to extract these parameter and send the e-mail out to whatever vendors needs to go.&lt;BR /&gt;&lt;BR /&gt;If you can help with this, I really appreciated. &lt;BR /&gt;&lt;BR /&gt;Thank you so much.&lt;BR /&gt;&lt;BR /&gt;Reynaldo Torres</description>
      <pubDate>Thu, 16 Aug 2001 23:53:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566410#M30022</guid>
      <dc:creator>Reynaldo Torres</dc:creator>
      <dc:date>2001-08-16T23:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: I need help to write a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566411#M30023</link>
      <description>Reynaldo,&lt;BR /&gt;&lt;BR /&gt;Do we need to extract the information from Oracle tables or is already there in the output files?&lt;BR /&gt;&lt;BR /&gt;Do we have to send mail to the buyer that is there in the output file?&lt;BR /&gt;&lt;BR /&gt;Your message is not clear. Please explain in detail.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 17 Aug 2001 02:29:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566411#M30023</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-17T02:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: I need help to write a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566412#M30024</link>
      <description>Hi&lt;BR /&gt;  If the data is in oracle tables.&lt;BR /&gt;Assuming that it exists in a single table you can do&lt;BR /&gt;&lt;BR /&gt;#! /sbin/sh&lt;BR /&gt;sqlplus login/passwd &amp;lt;&amp;lt; INPUT&lt;BR /&gt;set heading off echo off termout off pagesize 0 space 0&lt;BR /&gt;spool output.lst&lt;BR /&gt;select EFILE||','||BUYER_EMAIL||','||VENDOR_EMAIL||','||PO_NUMBER from table_name;&lt;BR /&gt;spool off&lt;BR /&gt;INPUT&lt;BR /&gt;  &lt;BR /&gt;#Now you have the output in the from&lt;BR /&gt;#efile,buyer_email,vendor_email,po_number &lt;BR /&gt;# in the file output.lst&lt;BR /&gt;# In the same file&lt;BR /&gt;&lt;BR /&gt;while read eachline ; do&lt;BR /&gt;    file=`echo $eachline| awk -F, '{ print $1 }'`&lt;BR /&gt;    buyer_email=`echo $eachline| awk -F, '{ print $2 }'`&lt;BR /&gt;    vendor_email=`echo $eachline| awk -F, '{ print $3 }'`&lt;BR /&gt;    po_number=`echo $eachline| awk -F, '{ print $4 }'`&lt;BR /&gt;   `/usr/sbin/sendmail $buyer_mail &amp;lt; $file`&lt;BR /&gt;done&lt;OUTPUT.LST&gt;&lt;/OUTPUT.LST&gt;&lt;BR /&gt;  This send the file contents to the buyer_email.&lt;BR /&gt;I am not sure what you want to do with the other two variables.&lt;BR /&gt;  Hope this helps...&lt;BR /&gt;...BPK...</description>
      <pubDate>Fri, 17 Aug 2001 05:11:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566412#M30024</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-08-17T05:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: I need help to write a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566413#M30025</link>
      <description>Hello Reynaldo,&lt;BR /&gt;&lt;BR /&gt;I'm not sure I understood your question completely, but it sounds to me that you want to pull the variables from the EFILE?  I put together a script, making a TON of assumptions.  Hopefully you will find it a little bit useful.  If you do want to pull the values from the EFILE, please give us a copy of it so that we can see what format it has.&lt;BR /&gt;&lt;BR /&gt;I think I must have a little too much time on my hands, but here is what I came up with. :)&lt;BR /&gt;&lt;BR /&gt;&lt;EFILE&gt;&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;BUYER_EMAIL=root&lt;BR /&gt;BUYER_EMAIL=jwestgate@sunsoftlenses.com&lt;BR /&gt;VENDOR_EMAIL=root&lt;BR /&gt;VENDOR_EMAIL=jwestgate@sunsoftlenses.com&lt;BR /&gt;PO_NUMBER=123456&lt;BR /&gt;ITEM1=3423&lt;BR /&gt;DESC1=Blue Glow in the dark basketball&lt;BR /&gt;QTY1=23&lt;BR /&gt;PRICE1=13.00&lt;BR /&gt;ITEM2=2342&lt;BR /&gt;DESC2=Giant batch of Sea Monkeys&lt;BR /&gt;QTY2=3000&lt;BR /&gt;PRICE2=Priceless!&lt;BR /&gt;TOTAL=41300.00&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;EFILE="/tmp/testfile"&lt;BR /&gt;BUYER_EMAILS=`cat $EFILE | grep "BUYER_EMAIL" | cut -f 2 -d "="`&lt;BR /&gt;VENDOR_EMAILS=`cat $EFILE | grep "VENDOR_EMAIL" | cut -f 2 -d "="`&lt;BR /&gt;PO_NUMBER=`cat $EFILE | grep "PO_NUMBER" | cut -f 2 -d "="`&lt;BR /&gt;POMAILFILE="/tmp/pomail.tmp"&lt;BR /&gt;&lt;BR /&gt;echo $BUYER_EMAILS&lt;BR /&gt;echo $VENDOR_EMAILS&lt;BR /&gt;&lt;BR /&gt;for BUYER_EMAIL in $BUYER_EMAILS&lt;BR /&gt;do&lt;BR /&gt;        echo "&lt;BR /&gt;Thank you for shopping with us!&lt;BR /&gt;Your order has been placed.&lt;BR /&gt;" | mailx -s "Thank you for your purchase" $BUYER_EMAIL&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;for VENDOR_EMAIL in $VENDOR_EMAILS&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;echo "&lt;BR /&gt;We would like to purchase the following items.&lt;BR /&gt;Please find the attached Purchase Order,&lt;BR /&gt;PO# $PO_NUMBER&lt;BR /&gt;&lt;BR /&gt;" &amp;gt; $POMAILFILE&lt;BR /&gt;cat $POMAILFILE $EFILE | mailx -s "Purchase Order $PO_NUMBER" $VENDOR_EMAIL&lt;BR /&gt;done&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Ok, ok... So this is probably completely useless to you, but I hope there is a slim chance you'll find what you need here.  If you can give us any more information, it would be great.&lt;BR /&gt;&lt;BR /&gt;Best of luck!&lt;BR /&gt;&lt;BR /&gt;Jared&lt;BR /&gt;&lt;/EFILE&gt;</description>
      <pubDate>Fri, 17 Aug 2001 19:18:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566413#M30025</guid>
      <dc:creator>Jared Westgate_1</dc:creator>
      <dc:date>2001-08-17T19:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: I need help to write a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566414#M30026</link>
      <description>Thanks to all of you who sent me examples on how to write scripts they really helped me to get the idea to write the script that I needed in order to pull the data as well to send the e-mail.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;&lt;BR /&gt;Reynaldo.</description>
      <pubDate>Fri, 17 Aug 2001 22:50:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-need-help-to-write-a-script/m-p/2566414#M30026</guid>
      <dc:creator>Reynaldo Torres</dc:creator>
      <dc:date>2001-08-17T22:50:31Z</dc:date>
    </item>
  </channel>
</rss>

