This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Timing problem
- To: "Morrison, John" <cygwin at cygwin dot com>
- Subject: Re: Timing problem
- From: jcast at cate1-208 dot reshall dot ou dot edu
- Date: Fri, 06 Jul 2001 11:24:11 -0500
> 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/