LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-25-2007, 09:27 AM   #1
WingnutOne
Member
 
Registered: Sep 2007
Location: Kansas City
Distribution: Mixed, mostly RH / Fedora
Posts: 76

Rep: Reputation: 16
Question What's messing with my time command?


This question arises out of another post I made on the Newbie forum at http://www.linuxquestions.org/questi...d.php?t=587049

Something is overriding my time command. If I run it by a full path command /usr/bin/time, then all of it's options work as described in the man page. If I don't give it the full path though, then most of the arguments don't work and BASH tries to interpret them as separate commands (which error out because "-o", "-v", etc. aren't valid commands).
I've checked all of the usual suspects that I thought might cause a command to be altered but none of them turned up anything:
/root/.bashrc
/etc/bashrc
/etc/profile
The BASH man page - in case BASH had a built-in time command that was superceding the separate binary. (It didn't.)
I also checked my $PATH statement but didn't find a time command anywhere other than in /usr/bin/.

I can work around it just by giving it the full path, but I'd really like to know where/how this is happening.

Thanks in advance for any ideas you may have.

Wingnut
 
Old 09-25-2007, 09:53 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
It's a shell internal command in bash. From the bash manual page:
Quote:
If the time reserved word precedes a pipeline, the elapsed as well as user and system time consumed by its execution are reported when the pipeline terminates. The -p option changes the output format to that specified by POSIX. The TIMEFORMAT variable may be set to a format string that specifies how the timing information should be displayed.
I didn't find this yesterday when I read the other thread, but today I did... the bash manual page is a bit of a pain in the format of a single document, but the content is golden.

Last edited by matthewg42; 09-25-2007 at 04:04 PM. Reason: typo: shall -> shell
 
Old 09-25-2007, 11:35 AM   #3
WingnutOne
Member
 
Registered: Sep 2007
Location: Kansas City
Distribution: Mixed, mostly RH / Fedora
Posts: 76

Original Poster
Rep: Reputation: 16
I looked through the bash man page three times before posting this and didn't find that! Guess I was looking more for a separate Time command definition sticking out on the left edge like the other bash commands have had (for, case, if, while, etc.).

Thanks again!
 
Old 09-25-2007, 11:59 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Quote:
Originally Posted by WingnutOne View Post
Guess I was looking more for a separate Time command definition sticking out on the left edge like the other bash commands have had (for, case, if, while, etc.).
heh, that's exactly what I was looking for when I couldn't find it, using the less command:
Code:
/^ *time
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
time of command abhishekrahel Linux - Desktop 2 08-24-2007 07:44 PM
what is the command 'time'? buuchanh Linux - Newbie 3 10-13-2005 01:46 PM
time command krock923 Programming 11 07-09-2005 04:46 PM
time command twantrd Linux - General 3 12-08-2004 03:54 PM
find command with time linuxtesting2 Linux - Newbie 1 09-22-2004 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration