title: Parse download speed from wget output in terminal
body: <p>I have the following command </p>
  
  <p><code>sudo wget --output-document=/dev/null http://speedtest.pixelwolf.ch</code> which outputs</p>
  
  <pre><code>--2016-03-27 17:15:47-- http://speedtest.pixelwolf.ch/
  Resolving speedtest.pixelwolf.ch (speedtest.pixelwolf.ch)... 178.63.18.88, 2a02:418:3102::6
  Connecting to speedtest.pixelwolf.ch (speedtest.pixelwolf.ch) | 178.63.18.88|:80... connected.
  HTTP Request sent, awaiting response... 200 OK
  Length: 85 [text/html]
  Saving to: `/dev/null`
  
  100%[======================&gt;]85     --.-K/s in 0s
  
  2016-03-27 17:15:47 (8.79 MB/s) - `dev/null` saved [85/85]
  </code></pre>
  
  <p>I'd like to be able to parse the <code>(8.79 MB/s)</code> from the last line and store this in a file (or any other way I can get this into a local PHP file easily), I tried to store the full output by changing my command to <code>--output-document=/dev/speedtest</code> however this just saved "Could not reach website" in the file and not the terminal output of the command. </p>
  
  <p>Not quite sure where to start with this, so any help would be awesome.</p>
  
  <p>Not sure if it helps, but my intention is for this stored value (<code>8.79</code>) in this instance to be read by a PHP file and handled there, every 30 seconds which I'll achieve by: <code>while true; do (run speed test and save speed variable to a file cmd); php handleSpeedTest.php; sleep 5; done</code> where handleSpeedTest.php will be able to read that stored value and handle it accordingly. </p>