Capturing the output of bash time in script variable

Viewed 2805

I'm trying this:

TIMEFORMAT=%R;
foo=$(time wget http://www.mysite.com)
echo $foo

and when I execute I see the number I want in the output but not in variable foo (echo $foo print nothing).

Why is that?

1 Answers
Related