如何获得bash脚本的返回

时间:2018-06-16 19:06:55

标签: bash unix centos

我想获得bash脚本speedtest-cli的返回(它用于检查互联网的速度),我的系统是CentOS。

这是./speedtest-cli:

的回归
[root@192 ~]# ./speedtest-cli
Retrieving speedtest.net configuration...
Testing from Oi Velox (179.198.68.183)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Station Net Provedor (Duque de Caxias) [10.54 km]: 37.818 ms
Testing download speed................................................................................
Download: 50.2 Mbit/s
Testing upload speed................................................................................................
Upload: 12.69 Mbit/s

我想要一个bash脚本来获得这部分返回"下载:50.2 Mbit / s"并将其保存在变量中,我该怎么做?

PS:这是位于巴西里约热内卢的CentOS 6.9服务器。

0 个答案:

没有答案
相关问题