- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Two "time" commands?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
- Report Inappropriate Content
тАО04-11-2008 08:59 AM
тАО04-11-2008 08:59 AM
Two "time" commands?
# /usr/bin/time sleep 3 2>test
# cat test
real 3.0
user 0.0
sys 0.0
If I don't specify the full path, and just use "time" by itself, I get two decimals and the stderr won't redirect:
# time sleep 3 2>test
real 0m3.02s
user 0m0.00s
sys 0m0.00s
# cat test
#
I assumed that there must be two versions of "time" available, and my path finds the 2-decimal one first, but:
# which time
/usr/bin/time
Huh? I'm very confused. Anybody know how I can capture the 2-decimal output of "time"?
- Tags:
- time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 09:26 AM
тАО04-11-2008 09:26 AM
Re: Two "time" commands?
Sure seems like two different commands. Try "whence time", "whereis time", "type time" to see if you can find something other than /usr/bin/time.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 09:32 AM
тАО04-11-2008 09:32 AM
Re: Two "time" commands?
There is 'time' and 'timex'. One posibility is that your 'time' has been aliased to 'timex'.
# alias time timex
As Pete suggesed, do:
# whence -v time
You might see:
time is an alias for timex
Regards!
...JRF...
- Tags:
- timex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 09:52 AM
тАО04-11-2008 09:52 AM
Re: Two "time" commands?
time
# whereis time
time: /usr/bin/time /usr/share/man/man1.Z/time.1 /usr/share/man/man2.Z/time.2
# type time
time is a keyword
I do have an alias that "type=whence -v", for whatever reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 10:11 AM
тАО04-11-2008 10:11 AM
Re: Two "time" commands?
Sounds like a solution:
http://docs.hp.com/en/B2355-60103/ksh.1.html
...
time pipeline
pipeline is executed and the elapsed time, user time, and system time are printed on standard error. Note that the time keyword can appear anywhere in the pipeline to time the entire pipeline. To time a particular command in a pipeline, see time(1).
...
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 10:25 AM
тАО04-11-2008 10:25 AM
Re: Two "time" commands?
That's interesting (maybe). On my 11.11 box, I get:
# type time
time is /usr/bin/time
Does anybody know what is meant by "keyword"?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 10:30 AM
тАО04-11-2008 10:30 AM
Re: Two "time" commands?
That means it is a shell built-in command.
Try doing a 'type while' and you will get the same thing.
I'm not sure why you'd be getting that in this case though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 10:31 AM
тАО04-11-2008 10:31 AM
Re: Two "time" commands?
"Note that the shell also has a keyword time that times an entire pipeline if used anywhere in the pipeline, unlike time(1) command which times a particular command if used in a pipeline."
So your first result is from the command /usr/bin/time and the second result is from the shell (ksh or csh, by the way) keyword.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 10:33 AM
тАО04-11-2008 10:33 AM
Re: Two "time" commands?
# whence time
/usr/bin/time
# type time
time is /usr/bin/time
with ksh:
# whence time
time
# type time
time is a keyword
Sounds reasonable ...
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2008 10:37 AM
тАО04-11-2008 10:37 AM
Re: Two "time" commands?
What shell are you using?
For the Posix shell (on a PA-RISC 11.23 box), a shell-builtin (like 'test') looks like:
# whence -v time
time is /usr/bin/time
# whence -v test
test is a shell builtin.
It would be interesting to see your shell aliases too:
# alias
Regards!
...JRF...