- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Help Needed For "time" command in HP-UX and Linux
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-18-2005 12:54 AM
11-18-2005 12:54 AM
Help Needed For "time" command in HP-UX and Linux
I need to use 'time
man page of 'time' in HP-UX says that the times (real,user and sys) will be printed in stderr.
linux (RHEL) man page of time says that the times (real,user and sys) will be printed in stdout.
But any amount of redirection attempt like below are failing: -
time sleep 1 2>/tmp/xxx
time sleep 1 >/tmp/xx
time sleep 1 |tee /tmp/xxx
time sleep 1|grep real >/tmp/xxx
TIME_ELAPSED=`time sleep 1`; echo $TIME_ELAPSED
etc...in both HP-UX and RHEL.
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.
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.
Thanking you in advance.
Sujoy Sarkar
Hewlett-Packard Co.
Bangalore - India
Ph: +91 80 2205 3084
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-18-2005 12:59 AM
11-18-2005 12:59 AM
Re: Help Needed For "time" command in HP-UX and Linux
http://hpux.ws/merijn/caljd-2.23.sh
http://hpux.ws/merijn/caljd-2.2.pl
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-18-2005 01:35 AM
11-18-2005 01:35 AM
Re: Help Needed For "time" command in HP-UX and Linux
#!/bin/ksh
time --output time.out ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-18-2005 02:50 AM
11-18-2005 02:50 AM
Re: Help Needed For "time" command in HP-UX and Linux
'time' sleep 1 2> /tmp/xx
/usr/bin/time sleep 1 2> /tmp/xx
(time sleep 1) 2> /tmp/xx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-07-2006 11:19 PM
06-07-2006 11:19 PM
Re: Help Needed For "time" command in HP-UX and Linux
The solutions really helped me get going.
Thanks.
\Sujoy
Hewlett-Packard Co.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP