I was hacking at a small script earlier and noticed something I can't explain.
Running this command
(time wget --spider http://www.google.co.uk/) 2>&1 | egrep 'real|response'
gives me this output (which I expect)
HTTP request sent, awaiting response... 200 OK
real 0m0.086s
I capture the output above in a variable
Result=$((time wget --spider http://www.google.co.uk/) 2>&1 | egrep 'real|response')
If I
echo "$Result"
I get the expected output
HTTP request sent, awaiting response... 200 OK
real 0m0.086s
However if I
echo $Result
I get
HTTP request sent, awaiting response... 200 OK real 0m0.086s
Why is that ?
wget -q
here, if you haven't figured it out yet. – Gilles 'SO- stop being evil' May 26 '11 at 22:06