<?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 scripting help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428002#M707337</link>
    <description>Whenever a file is put on the server it goes to the root /interface/Exel and the file type is xxxx.INT.&lt;BR /&gt;If it is larger than 1kb, i want to rename it to exel887_$(%Y%m%H%M%S).txt.&lt;BR /&gt;If it is less than 1kb, i want to rename it to exel997__$(%Y%m%H%M%S.txt.&lt;BR /&gt;&lt;BR /&gt;I would like to make it as looping script because there are more than 2 INT extension files in the directory.</description>
    <pubDate>Mon, 22 Nov 2004 17:08:17 GMT</pubDate>
    <dc:creator>Brian Lee_4</dc:creator>
    <dc:date>2004-11-22T17:08:17Z</dc:date>
    <item>
      <title>scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428002#M707337</link>
      <description>Whenever a file is put on the server it goes to the root /interface/Exel and the file type is xxxx.INT.&lt;BR /&gt;If it is larger than 1kb, i want to rename it to exel887_$(%Y%m%H%M%S).txt.&lt;BR /&gt;If it is less than 1kb, i want to rename it to exel997__$(%Y%m%H%M%S.txt.&lt;BR /&gt;&lt;BR /&gt;I would like to make it as looping script because there are more than 2 INT extension files in the directory.</description>
      <pubDate>Mon, 22 Nov 2004 17:08:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428002#M707337</guid>
      <dc:creator>Brian Lee_4</dc:creator>
      <dc:date>2004-11-22T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428003#M707338</link>
      <description>Hi Brian,&lt;BR /&gt;&lt;BR /&gt;Test this before you go for it. Hopefully I understood your requirement.&lt;BR /&gt;&lt;BR /&gt;LIMIT=1&lt;BR /&gt;DIR=/interface/Exel&lt;BR /&gt;DATE=$(date +%Y%m%H%M%S)&lt;BR /&gt;&lt;BR /&gt;ls -1 $DIR/*.INT|while read ENTRY&lt;BR /&gt;do&lt;BR /&gt;FILE=$(basename "$ENTRY")&lt;BR /&gt;SZ=$(du -ks "$ENTRY"|awk '{print $1}')&lt;BR /&gt;if [[ $SZ -ge $LIMIT ]]&lt;BR /&gt;then&lt;BR /&gt;mv $DIR/"$FILE" $DIR/"${FILE}_exel887_${DATE}.txt"&lt;BR /&gt;else&lt;BR /&gt;mv $DIR/"$FILE" $DIR/"${FILE}_exel997_${DATE}.txt"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 22 Nov 2004 17:41:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428003#M707338</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-11-22T17:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428004#M707339</link>
      <description>The first thing you better put into your script is a delay loop to at least check the size of the file twice because it may be growing at the very moment you determine its size.&lt;BR /&gt;&lt;BR /&gt;If I were doing this, I would make use of Perl's stat and localtime functions. &lt;BR /&gt;&lt;BR /&gt;You also need to clarify whether you want the current time or the file's last modication time. This is an easy script but writing it for you does you no favors. You need to do a bit on your own first.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Nov 2004 17:51:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428004#M707339</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-11-22T17:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428005#M707340</link>
      <description>My point is about not doing it for you is appropriate because you ranked yourself in your Profile as an expert in this area.</description>
      <pubDate>Mon, 22 Nov 2004 17:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help/m-p/3428005#M707340</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-11-22T17:54:05Z</dc:date>
    </item>
  </channel>
</rss>

