home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4585 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.3 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!darwin.sura.net!haven.umd.edu!decuac!pa.dec.com!decprl!decprl!boyd
  2. From: boyd@prl.dec.com (Boyd Roberts)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: How to redirect outputs from the command "time" into a file?
  5. Message-ID: <1992Nov7.155128.27140@prl.dec.com>
  6. Date: 7 Nov 92 15:51:28 GMT
  7. References: <1992Nov5.024837.6571@cs.tulane.edu> <fish.720983465@news2.gsfc.nasa.gov> <1992Nov6.231410.28155@ccd.harris.com>
  8. Sender: news@prl.dec.com (USENET News System)
  9. Organization: Digital Equipment Corporation - Paris Research Laboratory
  10. Lines: 27
  11. Nntp-Posting-Host: prl313.prl.dec.com
  12.  
  13. In article <1992Nov6.231410.28155@ccd.harris.com>, zhu@controls.ccd.harris.com (Gary Zhu) writes:
  14. > "time"  will consider the rest of the line as a whole, so
  15.  
  16. Nonsense.
  17.  
  18. > time a.out 2>a.time
  19. > will be interpreted as :  run  "a.out 2>a.time"  and report the
  20. > running time of "a.out 2>a.time".
  21.  
  22. time will be handed one argument.  Commands _never_ see I/O redirections.
  23. I/O redirections are performed by the shell.  This is UNIX, not DOS.
  24.  
  25. > SOLUTION :    (time  a.out) 2>a.time
  26. >                                      Gary
  27.  
  28. Which is functionally equivalent to:
  29.  
  30.     time a.out 2> a.time
  31.  
  32.  
  33. Boyd Roberts            boyd@prl.dec.com
  34.  
  35. ``Not only is UNIX dead, it's starting to smell really bad.''  -- Rob Pike
  36.