<?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 Help needed for Small Script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724780#M63994</link>
    <description>Hello all,&lt;BR /&gt;              I was wondering if you can help me with my little script. The purpose of the script is to send me an email with every text file that contains more than 1 line as a seperate attachement. Here is my code.&lt;BR /&gt;&lt;BR /&gt;**************************************&lt;BR /&gt;#/bin/sh&lt;BR /&gt;ls *.txt | while read FILE&lt;BR /&gt;do&lt;BR /&gt; NL=`wc -l $FILE | awk '{print $1}'`&lt;BR /&gt; if [ $NL -gt 1 ]; then&lt;BR /&gt; ls $FILE | awk '{ system ("ux2dos " $1 " | uuencode " $1 " | /usr/lib/sendmail &lt;EMAILADDRESS&gt;" )}'&lt;BR /&gt; fi&lt;BR /&gt;done&lt;BR /&gt;***************************************************&lt;BR /&gt;&lt;BR /&gt;The problem with that script, is that it sends an email per file. (of course).&lt;BR /&gt;I was wondering if you can tell me a way to send 1 email with all txt files as seperate attachements sent.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/EMAILADDRESS&gt;</description>
    <pubDate>Wed, 15 May 2002 16:44:10 GMT</pubDate>
    <dc:creator>Mark Blonde</dc:creator>
    <dc:date>2002-05-15T16:44:10Z</dc:date>
    <item>
      <title>Help needed for Small Script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724780#M63994</link>
      <description>Hello all,&lt;BR /&gt;              I was wondering if you can help me with my little script. The purpose of the script is to send me an email with every text file that contains more than 1 line as a seperate attachement. Here is my code.&lt;BR /&gt;&lt;BR /&gt;**************************************&lt;BR /&gt;#/bin/sh&lt;BR /&gt;ls *.txt | while read FILE&lt;BR /&gt;do&lt;BR /&gt; NL=`wc -l $FILE | awk '{print $1}'`&lt;BR /&gt; if [ $NL -gt 1 ]; then&lt;BR /&gt; ls $FILE | awk '{ system ("ux2dos " $1 " | uuencode " $1 " | /usr/lib/sendmail &lt;EMAILADDRESS&gt;" )}'&lt;BR /&gt; fi&lt;BR /&gt;done&lt;BR /&gt;***************************************************&lt;BR /&gt;&lt;BR /&gt;The problem with that script, is that it sends an email per file. (of course).&lt;BR /&gt;I was wondering if you can tell me a way to send 1 email with all txt files as seperate attachements sent.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/EMAILADDRESS&gt;</description>
      <pubDate>Wed, 15 May 2002 16:44:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724780#M63994</guid>
      <dc:creator>Mark Blonde</dc:creator>
      <dc:date>2002-05-15T16:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for Small Script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724781#M63995</link>
      <description>First create a file with the following line-&lt;BR /&gt;&lt;BR /&gt;[include test1.txt application/text base64]&lt;BR /&gt;[include test2.txt application/text base64]&lt;BR /&gt;&lt;BR /&gt;Second from the command line:&lt;BR /&gt;elm -s "your subject" user@yoursite.com &lt;FILE&gt;&lt;/FILE&gt;&lt;BR /&gt;&lt;BR /&gt;Where "file" contains the necessary [include] lines.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 16:49:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724781#M63995</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-05-15T16:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for Small Script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724782#M63996</link>
      <description>The suggestion you have works fine. The only problem is that I don't exactly know how to fix the command ux2dos and/or uuencode so that the txt files sent through email are readable. can you help ?</description>
      <pubDate>Wed, 15 May 2002 17:55:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724782#M63996</guid>
      <dc:creator>Mark Blonde</dc:creator>
      <dc:date>2002-05-15T17:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for Small Script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724783#M63997</link>
      <description>You shouldn't have to worry about using encode on the text (the base64 takes care of that).&lt;BR /&gt;&lt;BR /&gt;The ux2dos will need to be run. So just copy each file to /tmp and email the converted files.&lt;BR /&gt;&lt;BR /&gt;Here is your script updated-&lt;BR /&gt;#/bin/sh &lt;BR /&gt;cat /tmp/listfiles&lt;BR /&gt;ls *.txt | while read FILE &lt;BR /&gt;do &lt;BR /&gt;NL=`wc -l $FILE | awk '{print $1}'` &lt;BR /&gt;if [ $NL -gt 1 ]; then&lt;BR /&gt;ux2dos &amp;lt;$FILE &amp;gt;/tmp/${FILE}crlf&lt;BR /&gt;echo "[include /tmp/${FILE}crlf application/text base64]" &amp;gt;&amp;gt;/tmp/listfiles&lt;BR /&gt;fi &lt;BR /&gt;done&lt;BR /&gt;elm -s "Here are your files" user@yoursite.com rm /tmp/listfiles&lt;BR /&gt;rm /tmp/*crlj&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 15 May 2002 19:42:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-for-small-script/m-p/2724783#M63997</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-05-15T19:42:27Z</dc:date>
    </item>
  </channel>
</rss>

