Skip to content

Instantly share code, notes, and snippets.

@jab416171 jab416171/
Last active Aug 29, 2015

What would you like to do?
result=$(speedtest --simple)
download=$(echo $result | grep -oP "(?<=Download: )[0-9\.]* .*?/s")
upload=$(echo $result | grep -oP "(?<=Upload: )[0-9\.]* .*?/s")
ping=$(echo $result | grep -oP "(?<=Ping: )[0-9\.]* .*?ms")
if [ ! -e $filename ]; then
echo "\"Date\",\"Upload\",\"Download\",\"Ping\"" > $filename
echo "\"$(date)\",\"$upload\",\"$download\",\"$ping\"" >> $filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.