Grep/Awk WGet Time

I am trying to grep/awk how long it takes to get a page. I am trying to use the following command.

time -p wget -q -O wget.tmp www.google.com 2>&1 | grep real

The problem is that my attempts to map stderr to stdout are being applied to wget not to time so all of the time output is displayed on the console and grep gets no input.

I have tried using the output parameters on time and an got error. (Same for --ouput.)

time -p -o time.tmp wget -q -O wget.tmp www.google.com 2>&1 
bash: -o: command not found
real 0.00
user 0.00
sys 0.00

The interesting thing about the last example is that if I had include the pipe to grep, I would not have seen the bash error but would have still seen the times confirming that the piping of stderr to stdout is not being applied to time.

Wes.

Hi.

And if you enclose the time in brackets?

(time -p wget -q -O wget.tmp www.google.com) 2>&1 | grep real

Thanks, new had to be a simple solution.

Wes.