Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function str_extract() {
- pattern=$1
- # Extract
- res=`grep "$pattern" $log | sed "s/$pattern//g"`
- # Drop trailing ...
- res=`echo $res | sed 's/[.][.][.]//g'`
- # Trim
- res=`echo $res | sed 's/^ *//g' | sed 's/ *$//g'`
- echo $res
- }
- download=`str_extract "Download: "`
- upload=`str_extract "Upload: "`
- Retrieving speedtest.net configuration...
- Testing from Telecomunicazioni S.p.A. ...
- Retrieving speedtest.net server list...
- Selecting best server based on ping...
- Hosted by Coolnetwork (Arezzo) [26.09 km]: 111.547 ms
- Testing download speed................................................................................
- Download: 2.06 Mbit/s
- Testing upload speed...............................................................................................
- .Upload: 1.81 Mbit/s
- Share results
- "2.06" #correct
- ".1.81" #wrong preceding dot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement