This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Timing problem



> What made you think of the brackets?  I think that the ls is being
> piped into grep.

This works on GNU/Linux:

[jcast@cate1-208 jcast]$ (time ls) 2>&1 | egrep '^real'
real	0m0.020s

The redirections `|' and `>' have higher precidence in bash than
`time'.  The parentheses are required to force the precedence you
want.  (Actually, they are slightly more complicated, but that's the
gist.)  However, `time' prints to the standard error, so you need to
redirect that into you pipe, with `2>&1'.  If you just want to send
the output to a file, use `2> foo'.

Jon Cast


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]