home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5123 < prev    next >
Encoding:
Text File  |  1992-12-21  |  936 b   |  29 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!col.hp.com!fc.hp.com!pbm
  3. From: pbm@fc.hp.com (Peter McLain)
  4. Subject: Re: timing piped commands
  5. Sender: news@fc.hp.com (news daemon)
  6. Message-ID: <BzM9Iw.IGF@fc.hp.com>
  7. Date: Mon, 21 Dec 1992 15:54:32 GMT
  8. References: <1992Dec19.010201.2100@cs.sfu.ca>
  9. Organization: Hewlett-Packard Fort Collins Site
  10. X-Newsreader: TIN [version 1.1.3 PL6]
  11. Lines: 16
  12.  
  13. Xiaobing Chen (xiaobing@cs.sfu.ca) wrote:
  14. : Anybody tell me how to 'time' piped commands like:
  15. :     % time 'ls -lR | fgrep root'    # failed of course
  16.     You didn't mention which shell you are using, but from the prompt, I 
  17.     assume csh.  My man page for csh says that time only works on simple
  18.     commands, so you may be out of luck with csh (but I never use csh, so
  19.     could be wrong).
  20.  
  21.     If you have ksh, then the following will work:
  22.  
  23.     $ time { ls -lR | fgrep root ;}
  24.  
  25. Peter McLain
  26. pbm@fc.hp.com
  27.  
  28.