<?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: date increment in file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010237#M911256</link>
    <description>You need to put the date command inside the loop.&lt;BR /&gt;</description>
    <pubDate>Fri, 27 Jun 2003 17:37:40 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2003-06-27T17:37:40Z</dc:date>
    <item>
      <title>date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010235#M911254</link>
      <description>I put he following into a file called "CPU" &lt;BR /&gt;&lt;BR /&gt;echo "PID USER CPU% MEM_SIZE COMMAND" &lt;BR /&gt;while true &lt;BR /&gt;do &lt;BR /&gt;UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm | grep oracleD5751 &lt;BR /&gt;sleep 10 &lt;BR /&gt;done | sed 's;^;'$(date +'%m%d%H%M%S')' ;' &lt;BR /&gt;&lt;BR /&gt;I execute this file to put the contents into a log. &lt;BR /&gt;&lt;BR /&gt;date &amp;gt; cpu.log ; cpu &amp;gt;&amp;gt; /tmp/junk/cpu.log &lt;BR /&gt;&lt;BR /&gt;However the date time stamp on the output never increments. It prints the first date time and then repeats it with each interation? Any thoughts... &lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jun 2003 17:24:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010235#M911254</guid>
      <dc:creator>Jim Gerken</dc:creator>
      <dc:date>2003-06-27T17:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010236#M911255</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Until your while statement is completed, your sed won't get executed?.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 27 Jun 2003 17:34:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010236#M911255</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-06-27T17:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010237#M911256</link>
      <description>You need to put the date command inside the loop.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jun 2003 17:37:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010237#M911256</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-06-27T17:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010238#M911257</link>
      <description>Any thoughts on how I can change things around so the time increments each time the statement runs??</description>
      <pubDate>Fri, 27 Jun 2003 17:38:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010238#M911257</guid>
      <dc:creator>Jim Gerken</dc:creator>
      <dc:date>2003-06-27T17:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010239#M911258</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You can achieve this with:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "PID USER CPU% MEM_SIZE COMMAND" &lt;BR /&gt;while true &lt;BR /&gt;do &lt;BR /&gt;UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm | (echo `date +'%m%d%H%M%S'`;grep vhand)|xargs&lt;BR /&gt;sleep 10&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 27 Jun 2003 17:42:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010239#M911258</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-06-27T17:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010240#M911259</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Sorry, substitute 'oracleD5751' for 'vhand' [which I used to test :-)]&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "PID USER CPU% MEM_SIZE COMMAND" &lt;BR /&gt;while true &lt;BR /&gt;do &lt;BR /&gt;UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm |(echo `date +'%m%d%H%M%S'`;grep oracleD5751)|xargs&lt;BR /&gt;sleep 10&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jun 2003 17:45:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010240#M911259</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-06-27T17:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: date increment in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010241#M911260</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would do this&lt;BR /&gt;&lt;BR /&gt;FILE=/tmp/junk/cpu.log&lt;BR /&gt;echo "DATE        PID USER CPU% MEM_SIZE COMMAND" &amp;gt; $FILE&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;printf "$(date +'%m%d%H%M%S') " &amp;gt;&amp;gt; $FILE&lt;BR /&gt;UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm | grep oracleD5751 &amp;gt;&amp;gt; $FILE&lt;BR /&gt;sleep 2&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 27 Jun 2003 17:49:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-increment-in-file/m-p/3010241#M911260</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-06-27T17:49:19Z</dc:date>
    </item>
  </channel>
</rss>

