bash 'time' function

Chris F.A. Johnson c.f.a.johnson at rogers.com
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 torfree.net
	=================================================================
	c.f.a.johnson at rogers.com                http://cfaj.freeshell.org
	cfaj at freeshell.org        http://members.rogers.com/c.f.a.johnson

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



More information about the blfs-support mailing list