How to redirect outputs from the command "time" into a file?

How to redirect outputs from the command "time" into a file?

Post by Louis X. L » Fri, 06 Nov 1992 11:48:37



Hello, everyone:

My first question is about saving outputs from the timing command
"time" into a file. I tried "time a.out > a.time", but it did not
work. How to capture the outputs into a file?

My second related question is about the meanings of the outputs
from the command "time". I guess "real time" is real time, but what
is "user time"? What is "system time"? Our local man page does not
provide me with a satisfactory answer.

Thanks for your great help!

 
 
 

How to redirect outputs from the command "time" into a file?

Post by f.. » Sat, 07 Nov 1992 02:11:05



Quote:>My first question is about saving outputs from the timing command
>"time" into a file. I tried "time a.out > a.time", but it did not
>work. How to capture the outputs into a file?

time puts its output on stderr (not noted in any man page i've
ever seen either) so:
time a.out 2>a.time

                        fish
--

NASA/GSFC                         VOX: 301-513-1683                
Hughes/STX Corporation            FAX: 301-513-1608
"somehow seems strange and a little bit funny, to wander thirsty in the rain" pr

 
 
 

How to redirect outputs from the command "time" into a file?

Post by Gary Z » Sun, 08 Nov 1992 08:14:10



|>
|> >My first question is about saving outputs from the timing command
|> >"time" into a file. I tried "time a.out > a.time", but it did not
|> >work. How to capture the outputs into a file?
|> time puts its output on stderr (not noted in any man page i've
|> ever seen either) so:
|> time a.out 2>a.time
|>
|>                   fish
|> --

|> NASA/GSFC                         VOX: 301-513-1683                
|> Hughes/STX Corporation            FAX: 301-513-1608
|> "somehow seems strange and a little bit funny, to wander thirsty in the rain" pr

Almost got it.

"time"  will consider the rest of the line as a whole, so

time a.out 2>a.time

will be interpreted as :  run  "a.out 2>a.time"  and report the
running time of "a.out 2>a.time".

SOLUTION :    (time  a.out) 2>a.time

                                     Gary

 
 
 

How to redirect outputs from the command "time" into a file?

Post by Dave Eis » Mon, 09 Nov 1992 03:44:11




>|>
>|> time puts its output on stderr (not noted in any man page i've
>|> ever seen either) so:
>|> time a.out 2>a.time
>Almost got it.
>"time"  will consider the rest of the line as a whole, so
>time a.out 2>a.time
>will be interpreted as :  run  "a.out 2>a.time"  and report the
>running time of "a.out 2>a.time".

>SOLUTION :    (time  a.out) 2>a.time

Fish was right. Assuming a Bourne-like shell (he did use the 2>a.time
Bourne syntax), time couldn't possibly report the running time of the
redirected command because the redirection would occur before /bin/time
was called.

Of course, all of this changes if time is a shell builtin, like it
is in csh and tcsh and probably some others. Then time can (and in
the case of csh does) time the redirected command and your answer
would be correct if csh used the 2>a.time syntax for redirection.

--
Dave Eisen                               Sequoia Peripherals: (415) 967-5644

       There's something in my library to offend everybody.
          --- Washington Coalition Against Censorship

 
 
 

How to redirect outputs from the command "time" into a file?

Post by Boyd Rober » Mon, 09 Nov 1992 00:51:28



> "time"  will consider the rest of the line as a whole, so

Nonsense.

Quote:> time a.out 2>a.time

> will be interpreted as :  run  "a.out 2>a.time"  and report the
> running time of "a.out 2>a.time".

time will be handed one argument.  Commands _never_ see I/O redirections.
I/O redirections are performed by the shell.  This is UNIX, not DOS.

Quote:> SOLUTION :    (time  a.out) 2>a.time

>                                      Gary

Which is functionally equivalent to:

    time a.out 2> a.time


``Not only is UNIX dead, it's starting to smell really bad.''  -- Rob Pike

 
 
 

1. How to redirect outputs from the command "time" into a file?

Hello, everyone:

My first question is about saving outputs from the timing command
"time" into a file. I tried "time a.out > a.time", but it did not
work. How to capture the outputs into a file? ( I am running
AIX3.2 on RS/6000 model 550).

My second related question is about the meanings of the outputs
from the command "time". I guess "real time" is real time, but what
is "user time"? What is "system time"? InfoExplorer does not
provide me with a satisfactory answer.

Thanks for your great help!

2. X problems

3. can't redirect output of "time" command

4. help for handling signals

5. How to redirect the output of "time" command

6. help with curses

7. : Weird ">" redirect behavior vs. ">>" redirect behavior

8. Red Hat 6.0 Linux partition

9. redirecting output from "cron" command

10. redirect output from "time"???

11. Howto redirect the output of "time" into a variable?

12. GETSERVBYNAME()????????????????????"""""""""""""

13. "write" "to" "flon" commands