Timing Pipelines

Naim Abdullah naim at eecs.nwu.edu
Wed Mar 15 11:21:02 AEST 1989


How can one time a pipeline in the csh/sh so that the time returned
is that of the longest running process in the pipeline ?

So, for example running it on "ls | sleep 5" should return 5 seconds
assuming that the ls finishes before then.

A sample solution would be

% time sh -c "ls | sleep 5"

but that involves creating an extra process. Is there a clever
quoting trick that would avoid the extra process ?

Thanks.

		      Naim Abdullah
		      Dept. of EECS,
		      Northwestern University

		      Internet: naim at eecs.nwu.edu
		      Uucp: {oddjob, chinet, att}!nucsrl!naim



More information about the Comp.unix.questions mailing list