home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!spool.mu.edu!darwin.sura.net!mlb.semi.harris.com!controls.ccd.harris.com!zhu
- From: zhu@controls.ccd.harris.com (Gary Zhu)
- Subject: Re: How to redirect outputs from the command "time" into a file?
- Message-ID: <1992Nov6.231410.28155@ccd.harris.com>
- Originator: zhu@rs2
- Sender: zhu@controls (Gary Zhu)
- Organization: Harris Controls
- References: <1992Nov5.024837.6571@cs.tulane.edu> <fish.720983465@news2.gsfc.nasa.gov>
- Date: Fri, 6 Nov 1992 23:14:10 GMT
- Lines: 31
-
-
- In article <fish.720983465@news2.gsfc.nasa.gov>, fish@daacdev1.stx.com writes:
- |> mt0lamg@convex1.tcs.tulane.edu (Louis X. Lee) writes:
- |>
- |> >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
- |> --
- |> John R. Vanderpool INTERNET: fish@daacdev1.stx.com
- |> 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
-