Re: Problem with time command

2011-04-12 Thread Scott Ferguson
On 12/04/11 22:40, John Hasler wrote:
> Scott Ferguson writes:
>> Time *requires* a command before any arguments
> 
> That's the builtin.  Try "/usr/bin/time --version".

'Thanks John', but, please, read the original post:-
http://lists.debian.org/debian-user/2011/04/msg00446.html

Cheers

-- 
Tuttle? His name's Buttle.
There must be some mistake.
Mistake? [Chuckles]
We don't make mistakes.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4da4dac9.5020...@gmail.com



Re: Problem with time command

2011-04-12 Thread John Hasler
Scott Ferguson writes:
> Time *requires* a command before any arguments

That's the builtin.  Try "/usr/bin/time --version".
-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87pqortzh6@thumper.dhh.gt.org



Re: Problem with time command

2011-04-11 Thread Scott Ferguson
On 06/04/11 02:40, Fabio Dellacorte wrote:
> Hello everybody ,
> i want use option for time command but it doesn't work because
> �intepreted anything as argument :
> 
> 
> $time --version
> bash: --version: command not found
> 
> 
> Thank you
> 


Time *requires* a command before any arguments - hence your error message
So "time --version" will not return the version information for the
"time" command, but:-
time mlocate --version
will return the version information for *mlocate* and tell you how long
it took to do that. eg:-

scott@work:~$ time mlocate --version
mlocate 0.21.1
Copyright (C) 2007 Red Hat, Inc. All rights reserved.
This software is distributed under the GPL v.2.

This program is provided with NO WARRANTY, to the extent permitted by law.

real0m0.029s
user0m0.000s
sys 0m0.000s

from the man file:-
"time  run  the program COMMAND with any given arguments"

Cheers

-- 
Tuttle? His name's Buttle.
There must be some mistake.
Mistake? [Chuckles]
We don't make mistakes.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4da3df7f.7010...@gmail.com



Re: Problem with time command

2011-04-06 Thread Teemu Likonen
* 2011-04-05T14:02:34-05:00 * Boyd Stephen Smith, Jr. wrote:

> bss@dellbuntu:~$ type time
> time is a shell keyword

There is also this useful option "-a":

$ type -a time
time is a shell keyword
time is /usr/bin/time


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87vcyqpvh1@mithlond.arda



Re: Problem with time command

2011-04-06 Thread Chris Jackson
Boyd Stephen Smith Jr. wrote:

> In <4d9c342a.1090...@shadowcat.co.uk>, Chris Jackson wrote:
>>Boyd Stephen Smith Jr. wrote:
>>> GNU time 1.7
>>> bss@dellbuntu:~$ type time
>>> time is a shell keyword
>>> 
>>> (Bash has a time "builtin" that you should avoid if you want to use the
>>> time binary.)
>>
>>Actually it's a keyword not a builtin.
> 
> That's why I used quotes.  For most purposes it can be treated like a shell 
> builtin, but it's not really one.
> 
> Shell keywords are part of it's parser syntax,  ...


Yeah, I knew that ;) - I was wondering why. Given it's only recognised
at the start of the pipeline gives the clue I needed - it's so it can
time the whole pipeline rather than just a single command:

root@alice# time time dd if=/dev/urandom bs=1024 count=1024 | time gzip
-c -9 >/dev/null
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.77579 s, 1.4 MB/s
0.00user 0.48system 0:00.77elapsed 62%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+248minor)pagefaults 0swaps
0.18user 0.00system 0:00.78elapsed 23%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+218minor)pagefaults 0swaps

real0m0.785s
user0m0.184s
sys 0m0.500s

Curiosity satisfied - thanks!

--
Chris Jackson
Shadowcat Systems Ltd.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4d9c6f5a.5040...@shadowcat.co.uk



Re: Problem with time command

2011-04-06 Thread Boyd Stephen Smith Jr.
In <4d9c342a.1090...@shadowcat.co.uk>, Chris Jackson wrote:
>Boyd Stephen Smith Jr. wrote:
>> GNU time 1.7
>> bss@dellbuntu:~$ type time
>> time is a shell keyword
>> 
>> (Bash has a time "builtin" that you should avoid if you want to use the
>> time binary.)
>
>Actually it's a keyword not a builtin.

That's why I used quotes.  For most purposes it can be treated like a shell 
builtin, but it's not really one.

Shell keywords are part of it's parser syntax, and may or may not be 
valid/recognized everywhere a command.  Shell builtins are not part of the 
parser syntax, but are simply "found" before any binary in the PATH.  Shell 
special builtins modify properties of the shell process, so they can't be 
simply executed by fork/exec and are allowed to exit the shell in certain 
failure cases.

In this particular case, "time" isn't recognized as a keyword except as the 
first part of a pipeline.  When it is not recognized as a keyword, the time 
binary is used:
bss@monster:~$ time echo | time --version
GNU time 1.7

real0m0.002s
user0m0.000s
sys 0m0.000s
bss@monster:~$ # or even ...
bss@monster:~$ time time --version
GNU time 1.7

real0m0.002s
user0m0.000s
sys 0m0.000s

-- 
Boyd Stephen Smith Jr.   ,= ,-_-. =.
b...@iguanasuicide.net   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/\_/


signature.asc
Description: This is a digitally signed message part.


Re: Problem with time command

2011-04-06 Thread Chris Jackson
Boyd Stephen Smith Jr. wrote:

> GNU time 1.7
> bss@dellbuntu:~$ type time
> time is a shell keyword
> 
> (Bash has a time "builtin" that you should avoid if you want to use the time 
> binary.)


Actually it's a keyword not a builtin. By contrast, "kill":

chrisj@alice$ type kill
kill is a shell builtin

This also means you can't disable it:

chrisj@alice$ enable -n time
bash: enable: time: not a shell builtin

Not sure why time is a keyword (on a par with if, for etc.) rather than
a builtin, but there you go. If anyone has any enlightenment, I'd be
curious ;)

--
Chris Jackson
Shadowcat Systems Ltd.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4d9c342a.1090...@shadowcat.co.uk



Re: Problem with time command

2011-04-05 Thread Boyd Stephen Smith Jr.
On 2011-04-05 11:40:51 Fabio Dellacorte wrote:
>i want use option for time command but it doesn't work because  intepreted
>anything as argument :
>
>$time --version
>bash: --version: command not found

bss@dellbuntu:~$ time --version
bash: --version: command not found

real0m0.001s
user0m0.000s
sys 0m0.000s
bss@dellbuntu:~$ command time --version
GNU time 1.7
bss@dellbuntu:~$ type time
time is a shell keyword

(Bash has a time "builtin" that you should avoid if you want to use the time 
binary.)
-- 
Boyd Stephen Smith Jr.   ,= ,-_-. =.
b...@iguanasuicide.net  ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/\_/


signature.asc
Description: This is a digitally signed message part.


Re: Problem with time command

2011-04-05 Thread Tom Grace

On 05/04/11 17:40, Fabio Dellacorte wrote:

Hello everybody ,
i want use option for time command but it doesn't work because 
 intepreted anything as argument :

You may have better luck with the standalone "time"
$ /usr/bin/time --version
GNU time 1.7



$time --version
bash: --version: command not found


Thank you




--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4d9b46a4.3030...@deathbycomputers.co.uk



Problem with time command

2011-04-05 Thread Fabio Dellacorte
Hello everybody ,
i want use option for time command but it doesn't work because  intepreted
anything as argument :


$time --version
bash: --version: command not found


Thank you