<?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 For &amp;quot;time&amp;quot; command in HP-UX and Linux in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941731#M99873</link>
    <description>Thanks. The solutions helped me.</description>
    <pubDate>Thu, 08 Jun 2006 06:20:47 GMT</pubDate>
    <dc:creator>Sujoy</dc:creator>
    <dc:date>2006-06-08T06:20:47Z</dc:date>
    <item>
      <title>Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941723#M99865</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to use 'time &lt;COMMAND&gt;' command to calculate the "real" time elapsed during execution of the &lt;COMMAND&gt;, from shell and redirect the output in a file or may be in a variable. &lt;BR /&gt;&lt;BR /&gt;man page of 'time' in HP-UX says that the times (real,user and sys) will be printed in stderr. &lt;BR /&gt;linux (RHEL) man page of time says that the times (real,user and sys) will be printed in stdout.&lt;BR /&gt;&lt;BR /&gt;But any amount of redirection attempt like below are failing: - &lt;BR /&gt;&lt;BR /&gt;time sleep 1 2&amp;gt;/tmp/xxx&lt;BR /&gt;time sleep 1 &amp;gt;/tmp/xx&lt;BR /&gt;time sleep 1 |tee /tmp/xxx&lt;BR /&gt;time sleep 1|grep real &amp;gt;/tmp/xxx&lt;BR /&gt;TIME_ELAPSED=`time sleep 1`; echo $TIME_ELAPSED&lt;BR /&gt;&lt;BR /&gt;etc...in both HP-UX and RHEL. &lt;BR /&gt;&lt;BR /&gt;I also tried to use 'timex' as workaround which does not show this redirection problem. But 'timex' is not available in Linux, hence i need to fall back on 'time' only which works for both HP-UX and Linux. &lt;BR /&gt;&lt;BR /&gt;It shall be extremely helpful if you can tell me how to capture the output of 'time' command from shell into file or a shell variable. Also, if any other command can complement my requirement of calculating the elapsed time of an executed command that would also be very helpful. &lt;BR /&gt;&lt;BR /&gt;Thanking you in advance. &lt;BR /&gt;&lt;BR /&gt;Sujoy Sarkar&lt;BR /&gt;Hewlett-Packard Co.&lt;BR /&gt;Bangalore - India&lt;BR /&gt;Ph: +91 80 2205 3084&lt;BR /&gt;&lt;/COMMAND&gt;&lt;/COMMAND&gt;</description>
      <pubDate>Fri, 18 Nov 2005 08:52:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941723#M99865</guid>
      <dc:creator>Sujoy</dc:creator>
      <dc:date>2005-11-18T08:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941724#M99866</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Interesting, an old 10.20 'time' works.  On 11.11 I obtain your result.  I think "broken" is the word.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 18 Nov 2005 09:03:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941724#M99866</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-18T09:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941725#M99867</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;No, I think I'm crazy.  This works just fine on 11.11 :&lt;BR /&gt;&lt;BR /&gt;# time sleep 1 2&amp;gt;/tmp/xxx&lt;BR /&gt;&lt;BR /&gt;I was typing "times" instead. :-((&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 18 Nov 2005 09:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941725#M99867</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-18T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941726#M99868</link>
      <description>But "time sleep 1 2&amp;gt;/tmp/xxx"&lt;BR /&gt;&lt;BR /&gt;does not get the output into /tmp/xxx&lt;BR /&gt;&lt;BR /&gt;in "HP-UX ccux1 B.11.11 U 9000/800 1861980610 unlimited-user license"&lt;BR /&gt;&lt;BR /&gt;also in "HP-UX ccux3 B.11.23 U ia64 0943546897 unlimited-user license"&lt;BR /&gt;&lt;BR /&gt;It only throws the output in screen.&lt;BR /&gt;&lt;BR /&gt;--Sujoy</description>
      <pubDate>Fri, 18 Nov 2005 09:12:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941726#M99868</guid>
      <dc:creator>Sujoy</dc:creator>
      <dc:date>2005-11-18T09:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941727#M99869</link>
      <description>For me it is working correctly on 11.0, 11.11 and 11.23.&lt;BR /&gt;&lt;BR /&gt;# time sleep 1 2&amp;gt;/tmp/xxx&lt;BR /&gt;&lt;BR /&gt;# /tmp/xxx&lt;BR /&gt;real        1.0&lt;BR /&gt;user        0.0&lt;BR /&gt;sys         0.0</description>
      <pubDate>Fri, 18 Nov 2005 09:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941727#M99869</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-11-18T09:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941728#M99870</link>
      <description>Doesn't work for me on 11.11 either. Maybe it's a patch. The system I'm using is (as far as I know) fully patched up to Sept 2005 patch bundle.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Nov 2005 09:40:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941728#M99870</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-11-18T09:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941729#M99871</link>
      <description>Got it, it works in sh, but not in ksh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Nov 2005 09:45:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941729#M99871</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-11-18T09:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941730#M99872</link>
      <description>The trick is that time is a shell built-in command for some shells.  You can use a quoted command or full path to get the actual command that matches 'man time'.  Here is a sample from bash on linux.&lt;BR /&gt;&lt;BR /&gt;$ time sleep 1&lt;BR /&gt;&lt;BR /&gt;real    0m1.004s&lt;BR /&gt;user    0m0.001s&lt;BR /&gt;sys     0m0.001s&lt;BR /&gt;$ 'time' sleep 1&lt;BR /&gt;0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k&lt;BR /&gt;0inputs+0outputs (0major+200minor)pagefaults 0swaps&lt;BR /&gt;$ /usr/bin/time sleep 1&lt;BR /&gt;0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k&lt;BR /&gt;0inputs+0outputs (0major+199minor)pagefaults 0swaps&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Nov 2005 10:35:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941730#M99872</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2005-11-18T10:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed For "time" command in HP-UX and Linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941731#M99873</link>
      <description>Thanks. The solutions helped me.</description>
      <pubDate>Thu, 08 Jun 2006 06:20:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-needed-for-quot-time-quot-command-in-hp-ux-and-linux/m-p/4941731#M99873</guid>
      <dc:creator>Sujoy</dc:creator>
      <dc:date>2006-06-08T06:20:47Z</dc:date>
    </item>
  </channel>
</rss>

