<?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: Help needed to finish script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210338#M168397</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is there a date entry is tyhe master file? if so you can do issue a date command that has the same output as in the file and do a awk script that prints all entrys after the date string and redirect it to todays file.&lt;BR /&gt;&lt;BR /&gt;so:&lt;BR /&gt;VAR=$(date '+%d%m%y)&lt;BR /&gt;cat /sdata/files/log/sabscan.l09 | awk -v  date=$VAR '/$VAR/ {start=1}&lt;BR /&gt;start=1 {print}'&amp;gt;&amp;gt;/sjtds/home/sabfiles/plp13.`date '+%d%m%y'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Gideon&lt;BR /&gt;&lt;BR /&gt;PS. did not test this so may need to make  adjustments to get it working.&lt;BR /&gt;</description>
    <pubDate>Fri, 05 Mar 2004 05:04:46 GMT</pubDate>
    <dc:creator>G. Vrijhoeven</dc:creator>
    <dc:date>2004-03-05T05:04:46Z</dc:date>
    <item>
      <title>Help needed to finish script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210336#M168395</link>
      <description>Hi there people&lt;BR /&gt;&lt;BR /&gt;This command is part of a script I'm busy with   -  &lt;BR /&gt;cp /sdata/files/log/sabscan.l09 /sjtds/home/sabfiles/plp13.`date '+%d%m%y'`&lt;BR /&gt;&lt;BR /&gt;Now , the sabscan.l09 file is an ever increasing , master file , but I need to add a command to my line that will only remove all the day's stuff and put it into the new plp12.(today's date) file. The command cannot use a specified date , as this is gonna run in a cron daily , so it's gonna update and create files daily.&lt;BR /&gt;&lt;BR /&gt;Please help me URGENTLY !!!&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 04:48:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210336#M168395</guid>
      <dc:creator>Rudi Martin</dc:creator>
      <dc:date>2004-03-05T04:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed to finish script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210337#M168396</link>
      <description>How about:&lt;BR /&gt;touch /sjtds/home/sabfiles/plp13.`date '+%d%m%y'`  {create empty new daily file}&lt;BR /&gt;&lt;BR /&gt;cat /sdata/files/log/sabscan.l09 &amp;gt;&amp;gt; /sjtds/home/sabfiles/plp13.`date '+%d%m%y'` {append data to new file}&lt;BR /&gt;cat /dev/null &amp;gt; /sdata/files/log/sabscan.l09 {empty master file} &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 05:04:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210337#M168396</guid>
      <dc:creator>Jakes Louw</dc:creator>
      <dc:date>2004-03-05T05:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed to finish script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210338#M168397</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is there a date entry is tyhe master file? if so you can do issue a date command that has the same output as in the file and do a awk script that prints all entrys after the date string and redirect it to todays file.&lt;BR /&gt;&lt;BR /&gt;so:&lt;BR /&gt;VAR=$(date '+%d%m%y)&lt;BR /&gt;cat /sdata/files/log/sabscan.l09 | awk -v  date=$VAR '/$VAR/ {start=1}&lt;BR /&gt;start=1 {print}'&amp;gt;&amp;gt;/sjtds/home/sabfiles/plp13.`date '+%d%m%y'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Gideon&lt;BR /&gt;&lt;BR /&gt;PS. did not test this so may need to make  adjustments to get it working.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2004 05:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210338#M168397</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2004-03-05T05:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed to finish script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210339#M168398</link>
      <description>This isnÃ¦t possible without knowing if your file has a date in it and which format that date is in.  If each line in your file has "month day" then you would only need to &lt;BR /&gt; &lt;BR /&gt;grep `date +"%m %d"` /sdata/files/log/sabscan.l09 &amp;gt; /sjtds/home/sabfiles/plp13.`date '+%d%m%y'`&lt;BR /&gt; &lt;BR /&gt;However, if there is no date in there at all then you are going to have to set up a cron job  that moves sabscan.l09 to a backup file every day.  Something like this&lt;BR /&gt; &lt;BR /&gt;cat sabscan.l09 &amp;gt;&amp;gt; sabscan.l09.history &amp;amp;&amp;amp; &amp;gt; sabscan.l09&lt;BR /&gt; &lt;BR /&gt;Then you can use your normal script as sabscan.l09 will only ever contain todays data and sabscan.l09.history will contain all your previous days informatio</description>
      <pubDate>Fri, 05 Mar 2004 05:05:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210339#M168398</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-05T05:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed to finish script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210340#M168399</link>
      <description>Thanx Mark&lt;BR /&gt;&lt;BR /&gt;grep `date +"%d%m% y"` /sdata/files/log/sabscan.l09 &amp;gt; /sjtds/home/sabfiles/plp13.&lt;BR /&gt;`date '+%d%m%y'`&lt;BR /&gt;&lt;BR /&gt;working like a bomb !&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Fri, 05 Mar 2004 05:31:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-needed-to-finish-script/m-p/3210340#M168399</guid>
      <dc:creator>Rudi Martin</dc:creator>
      <dc:date>2004-03-05T05:31:50Z</dc:date>
    </item>
  </channel>
</rss>

