Hi all, I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like: time -o output-file command command-args time -v command command-args time --help but nothing of this works. All I get is (in the last example): bash: --help: command not found real 0m0.001s user 0m0.000s sys 0m0.000s I get the same thing in all option cases. Why doesn't it accept any option, and keep interpreting the options as the commands? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 18 May 2007 10:16, Herbert Georg wrote:
Hi all,
I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like:
...
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
...
I get the same thing in all option cases.
Why doesn't it accept any option, and keep interpreting the options as the commands?
Time exists both as a BASH built-in and as a binary executable. The man page for time describes the executable. Information about the BASH built-in is available in the BASH man page or via "help time". Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randall R Schulz wrote:
On Friday 18 May 2007 10:16, Herbert Georg wrote:
Hi all,
I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like:
...
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
...
I get the same thing in all option cases.
Why doesn't it accept any option, and keep interpreting the options as the commands?
Time exists both as a BASH built-in and as a binary executable. The man page for time describes the executable. Information about the BASH built-in is available in the BASH man page or via "help time".
And the "which" comamnd is your friend as in $ which time Be aware that $ which which can also yield interesting results (hint, there is /usr/bin/which and also built-in versions in ksh, pdksh, bash, and possibly csh and tcsh)
Randall Schulz
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis wrote:
And the "which" comamnd is your friend
Is this some sort of quiz? ;-) -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Herbert Georg wrote:
[...] I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like:
time -o output-file command command-args time -v command command-args time --help
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
real 0m0.001s user 0m0.000s sys 0m0.000s
I get the same thing in all option cases.
Why doesn't it accept any option, and keep interpreting the options as the commands?
You're using the shell builtin time command which does not support the options. Try /usr/bin/time and it will work. Cheers, Th. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 18 May 2007 12:16, Herbert Georg wrote:
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
real 0m0.001s user 0m0.000s sys 0m0.000s Try this:
which time You will probably notice that it just returns to the prompt... and does not tell you which time... because it is finding the one built into the shell. which /usr/bin/time Now you will notice that it finds the system time command--- and the two are different. compare: #>time #>/usr/bin/time The outputs will be different. Use the /usr/bin/time and you'll get what you want. -- Kind regards, M Harris <>< -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri May 18 2007 12:39, M Harris wrote:
Try this:
which time
You will probably notice that it just returns to the prompt... and does not tell you which time... because it is finding the one built into the shell.
which /usr/bin/time
Now you will notice that it finds the system time command--- and the two are different.
compare:
#>time
#>/usr/bin/time
The outputs will be different. Use the /usr/bin/time and you'll get what you want.
Now, here is a puzzle: clange@zico:~> which time /usr/bin/time clange@zico:~> type time time is a shell keyword clange@zico:~> time --help bash: --help: command not found real 0m0.011s user 0m0.000s sys 0m0.004s That is, in my case the built-in "time" has precedence, but "which" is giving the impression that I would be running /usr/bin/time. If I use the option -a: clange@zico:~> which -a time /usr/bin/time clange@zico:~> type -a time time is a shell keyword time is /usr/bin/time Since "which" gives out nothing in the case of a shell built-in command, perhaps what it is doing everytime is 1) giving out nothing, 2) giving out /usr/bin/time in second place. So, "type" seems to be more useful here. Carlos FL -- Who is General Failure, and why is he reading my disk? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 19 May 2007 10:15, Carlos F Lange wrote:
...
Now, here is a puzzle:
clange@zico:~> which time /usr/bin/time clange@zico:~> type time time is a shell keyword clange@zico:~> time --help bash: --help: command not found
real 0m0.011s user 0m0.000s sys 0m0.004s
That is, in my case the built-in "time" has precedence, but "which" is giving the impression that I would be running /usr/bin/time. If I use the option -a: clange@zico:~> which -a time /usr/bin/time clange@zico:~> type -a time time is a shell keyword time is /usr/bin/time
If the which command is the stock executable binary (often it's an alias to the BASH "type" built-in), then it does not know about built-ins in the shell that invoked and can tell you only about other stand-alone executables (binaries or scripts).
Since "which" gives out nothing in the case of a shell built-in command, perhaps what it is doing everytime is 1) giving out nothing, 2) giving out /usr/bin/time in second place. So, "type" seems to be more useful here.
Type is more useful since it has a greater scope. If you're inured to typing "which," then create an alias for it: alias which='type -p' (The "-p" option causes type to emit full path names, which makes its output compatible with that of "which".) You might want to know that there's a "-a" option to both "which" and "type" that cause them to print all instances of the named command in the PATH, instead of just the first one--the one you'll get if you just invoke the command without any path name qualification.
Carlos FL
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 19 May 2007 11:15:28 -0600, Carlos F Lange wrote:
clange@zico:~> which time /usr/bin/time clange@zico:~> type time time is a shell keyword clange@zico:~> time --help bash: --help: command not found
real 0m0.011s user 0m0.000s sys 0m0.004s
In bash, the 'which' command is normally an alias for the bash built-in command type (try 'type -a which'). Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 05/18/2007 01:16 PM somebody named Herbert Georg wrote:
Hi all,
I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like:
time -o output-file command command-args time -v command command-args time --help
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
real 0m0.001s user 0m0.000s sys 0m0.000s
I get the same thing in all option cases.
Why doesn't it accept any option, and keep interpreting the options as the commands?
Use what you want to time as the argument to the "time" command, e.g., $ time date Fri May 18 14:39:18 EDT 2007 real 0m0.002s user 0m0.000s sys 0m0.002s shows how long the "date" command took to execute. You can also add arguments to the "date" (or whatever) command used. -- "This world ain't big enough for the both of us," said the big noema to the little noema. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 18 May 2007 13:41, ken wrote:
Use what you want to time as the argument to the "time" command, e.g.,
$ time date Fri May 18 14:39:18 EDT 2007 Ken, you're missing his point.
... he knows how to time... what he wants is to use the -o switch to send the time to an output file... this will not work with the shell version of time... he must use: /usr/bin/time -o outputfile date This will time the date command and send the timing results to outputfile. -- Kind regards, M Harris <>< -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Herbert Georg wrote:
Hi all,
I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like:
time -o output-file command command-args time -v command command-args time --help
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
real 0m0.001s user 0m0.000s sys 0m0.000s
I get the same thing in all option cases.
Why doesn't it accept any option, and keep interpreting the options as the commands?
Interesting thread here. I summarized and added some new information in a blog post on my Daemon blog: http://freebsd.amazingdev.com/blog/archives/000873.html -- Jonathan Arnold (mailto:jdarnold@buddydog.org) Daemon Dancing in the Dark, an Open OS weblog: http://freebsd.amazingdev.com/blog/ UNIX is user-friendly. It's just a bit picky about who its friends are. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Jonathan Arnold <jdarnold@buddydog.org> [05-20-07 09:35]: [...]
Interesting thread here. I summarized and added some new information in a blog post on my Daemon blog:
AND, of course, you added this information to http://opensuse.org where those not knowing of your web site would be readily able to access the information? :^) -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 OpenSUSE Linux http://en.opensuse.org/ Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan wrote:
* Jonathan Arnold <jdarnold@buddydog.org> [05-20-07 09:35]: [...]
Interesting thread here. I summarized and added some new information in a blog post on my Daemon blog:
AND, of course, you added this information to http://opensuse.org where those not knowing of your web site would be readily able to access the information? :^)
Thanks for the reminder: http://en.opensuse.org/SDB:Which_command -- Jonathan Arnold (mailto:jdarnold@buddydog.org) Daemon Dancing in the Dark, an Open OS weblog: http://freebsd.amazingdev.com/blog/ UNIX is user-friendly. It's just a bit picky about who its friends are. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Fri, 18 May 2007 14:16:32 -0300 Herbert Georg <hcgeorg@if.usp.br> wrote:
Hi all,
I'm trying to use the command "time" to access information about a job, but without success. The man page tells me that I can use options to time, like:
time -o output-file command command-args time -v command command-args time --help
but nothing of this works. All I get is (in the last example):
bash: --help: command not found
real 0m0.001s user 0m0.000s sys 0m0.000s
I get the same thing in all option cases.
Why doesn't it accept any option, and keep interpreting the options as the commands?
What about this? :-)
\time --help Usage: time [-apvV] [-f format] [-o file] [--append] [--verbose] [--portability] [--format=format] [--output=file] [--version] [--help] command [arg...]
Regards, eshsf -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 21 May 2007 00:13:51 +0900, eshsf wrote:
What about this? :-)
\time --help
Sly fox :) Escaping the first letter disables bash's alias mechanism, so you get the external /usr/bin/time instead of the bash built-in. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (12)
-
Aaron Kulkis
-
Carlos F Lange
-
eshsf
-
Herbert Georg
-
James Knott
-
Jonathan Arnold
-
ken
-
M Harris
-
Patrick Shanahan
-
Philipp Thomas
-
Randall R Schulz
-
Thomas Hertweck