You are not logged in.

#1 2007-11-20 23:30:57

voodoo.child
Member
Registered: 2007-11-01
Posts: 30

problems with time command

I'm trying to use time to time a process, but I have problems with it. It doesn't accept other options than -p (though the manual says it should) and also I cannot redirect it's output. Can anybody help me?


--
Alexandru

Offline

#2 2007-11-21 01:06:04

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: problems with time command

The manual describes a binary you don't have. See the bash manpage and search for pipeline; time is described in that paragraph.


1000

Offline

#3 2007-11-21 10:26:10

voodoo.child
Member
Registered: 2007-11-01
Posts: 30

Re: problems with time command

how do I get that binary? I really need to reformat my output.


--
Alexandru

Offline

#4 2007-11-21 13:08:46

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: problems with time command

You want the time binary?  How about trying

pacman -S time

Offline

#5 2007-11-21 14:24:05

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: problems with time command

man bash wrote:

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 spec-
ified by POSIX.  The TIMEFORMAT variable may be set to a format string that specifies how the timing infor-
mation should be displayed; see the description of TIMEFORMAT under Shell Variables below.
.
.
.
TIMEFORMAT
              The  value  of  this  parameter is used as a format string specifying how the timing information for
              pipelines prefixed with the time reserved word should be displayed.  The % character  introduces  an
              escape  sequence  that  is  expanded to a time value or other information.  The escape sequences and
              their meanings are as follows; the braces denote optional portions.
              %%        A literal %.
              %[p][l]R  The elapsed time in seconds.
              %[p][l]U  The number of CPU seconds spent in user mode.
              %[p][l]S  The number of CPU seconds spent in system mode.
              %P        The CPU percentage, computed as (%U + %S) / %R.

              The optional p is a digit specifying the precision, the number of fractional digits after a  decimal
              point.   A  value of 0 causes no decimal point or fraction to be output.  At most three places after
              the decimal point may be specified; values of p greater than 3 are changed to 3.  If p is not speci-
              fied, the value 3 is used.

              The  optional l specifies a longer format, including minutes, of the form MMmSS.FFs.  The value of p
              determines whether or not the fraction is included.

              If this variable is not set, bash acts as if it had the value  $'\nreal\t%3lR\nuser\t%3lU\nsys%3lS'.
              If the value is null, no timing information is displayed.  A trailing newline is added when the for-
              mat string is displayed.


1000

Offline

Board footer

Powered by FluxBB