<?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 Script / mail attachment in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-mail-attachment/m-p/2433763#M4090</link>
    <description>Our customer send us data daily attach to e-mail.  Attach files come in the following format zip, tar etc.  Someone check for mail then unzip etc attachment.  &lt;BR /&gt;&lt;BR /&gt;I'm looking for a script that will check mail attachment an unzip or untar depending on attachment format.&lt;BR /&gt;&lt;BR /&gt;thanks,</description>
    <pubDate>Mon, 31 Jul 2000 16:10:48 GMT</pubDate>
    <dc:creator>Junior C.</dc:creator>
    <dc:date>2000-07-31T16:10:48Z</dc:date>
    <item>
      <title>Script / mail attachment</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-mail-attachment/m-p/2433763#M4090</link>
      <description>Our customer send us data daily attach to e-mail.  Attach files come in the following format zip, tar etc.  Someone check for mail then unzip etc attachment.  &lt;BR /&gt;&lt;BR /&gt;I'm looking for a script that will check mail attachment an unzip or untar depending on attachment format.&lt;BR /&gt;&lt;BR /&gt;thanks,</description>
      <pubDate>Mon, 31 Jul 2000 16:10:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-mail-attachment/m-p/2433763#M4090</guid>
      <dc:creator>Junior C.</dc:creator>
      <dc:date>2000-07-31T16:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script / mail attachment</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-mail-attachment/m-p/2433764#M4091</link>
      <description>Junior,&lt;BR /&gt;&lt;BR /&gt;Not sure what you are trying to accomplish here but are you talking about receiving attachment files and storing them on UNIX then determining how to unpack the files. If you are, you can store the file list in a UNIX file.  Use this UNIX file as an input control file to a while loop and process each entry in a loop.  Within the loop, run the file command on the file whos turn it is in the iteration.  Something like this:&lt;BR /&gt;&lt;BR /&gt;#   loop thru control file&lt;BR /&gt;    while true&lt;BR /&gt;    do&lt;BR /&gt;        read {1st file_name}&lt;BR /&gt;        #process each line here with file command&lt;BR /&gt;        #Perform string comparisons&lt;BR /&gt;        test "string" = "string"  #strings are equal&lt;BR /&gt;        test "string" != "string" #strings are not equal&lt;BR /&gt;        #Use case statement to determine how to unpack based on return of string comparison&lt;BR /&gt;    done &amp;lt; $INPUT_CONTROL_FILE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When you call the file command will print out messages such as the following:&lt;BR /&gt;&lt;BR /&gt;TAR FILE:  tar file&lt;BR /&gt;COMPRESSED FILE:  compressed data, block compressed, 16 bits&lt;BR /&gt;GZIP FILE:  awk program text&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Tony&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2000 17:01:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-mail-attachment/m-p/2433764#M4091</guid>
      <dc:creator>Anthony deRito</dc:creator>
      <dc:date>2000-07-31T17:01:29Z</dc:date>
    </item>
  </channel>
</rss>

