home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4583 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.5 KB  |  44 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!mlb.semi.harris.com!controls.ccd.harris.com!zhu
  3. From: zhu@controls.ccd.harris.com (Gary Zhu)
  4. Subject: Re: How to redirect outputs from the command "time" into a file? 
  5. Message-ID: <1992Nov6.231410.28155@ccd.harris.com>
  6. Originator: zhu@rs2
  7. Sender: zhu@controls (Gary Zhu)
  8. Organization: Harris Controls
  9. References: <1992Nov5.024837.6571@cs.tulane.edu> <fish.720983465@news2.gsfc.nasa.gov>
  10. Date: Fri, 6 Nov 1992 23:14:10 GMT
  11. Lines: 31
  12.  
  13.  
  14. In article <fish.720983465@news2.gsfc.nasa.gov>, fish@daacdev1.stx.com writes:
  15. |> mt0lamg@convex1.tcs.tulane.edu (Louis X. Lee) writes:
  16. |> 
  17. |> >My first question is about saving outputs from the timing command
  18. |> >"time" into a file. I tried "time a.out > a.time", but it did not
  19. |> >work. How to capture the outputs into a file?
  20. |> time puts its output on stderr (not noted in any man page i've
  21. |> ever seen either) so:
  22. |> time a.out 2>a.time
  23. |> 
  24. |>             fish
  25. |> --
  26. |> John R. Vanderpool                INTERNET: fish@daacdev1.stx.com
  27. |> NASA/GSFC                         VOX: 301-513-1683                
  28. |> Hughes/STX Corporation            FAX: 301-513-1608
  29. |> "somehow seems strange and a little bit funny, to wander thirsty in the rain" pr
  30.  
  31. Almost got it.
  32.  
  33. "time"  will consider the rest of the line as a whole, so
  34.  
  35. time a.out 2>a.time
  36.  
  37. will be interpreted as :  run  "a.out 2>a.time"  and report the
  38. running time of "a.out 2>a.time".
  39.  
  40.  
  41. SOLUTION :    (time  a.out) 2>a.time
  42.  
  43.                                      Gary
  44.