bash 'time' function

Chris F.A. Johnson c.f.a.johnson at
Thu Dec 20 20:39:52 PST 2001

On Fri, 21 Dec 2001, R. Bosch wrote:

> Sorry for beaking in, but  I got a problem with grepping the output of time.
> When I try # time sleep 3s | grep system # I get the normal output from time
> with 'all' times.

[N.B.: time prints 'sys', not 'system']

> Can someone tell me how to control the output of the time command!

The output of time is sent to stderr, so you need to redirect that to a
file or another process:

	{ time sleep 3s } 2> >( grep sys )

The braces are necessary so that you redirect the output of time, not
the output of sleep (or whatever command you are timing).

	Chris F.A. Johnson                              bq933 at
	c.f.a.johnson at      
	cfaj at

Unsubscribe: send email to listar at
and put 'unsubscribe blfs-support' in the subject header of the message

More information about the blfs-support mailing list