linux – 有可能抓住wget的最后一行吗?

$wget --output-document=/dev/null http://website.com/file.jpg

Resolving speedtest.sea01.softlayer.com... 67.228.112.250
Connecting to speedtest.sea01.softlayer.com|67.228.112.250|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1986284 (1.9M) [image/jpeg]
Saving to: `/dev/null'

2011-10-02 22:38:04 (337 KB/s) - `/dev/null' saved [1986284/1986284]

一切都在上面工作,但我想知道如何在变量中存储最后一行或通过GREP传递它 – > /((.))/

(我正在尝试解析平均KB / s)

解决方法:

您可以重定向命令的输出.例如:

$wget --output-document=/dev/null http://website.com/file.jpg 2>&1 | tee /tmp/somefile
$tail -n 1 /tmp/somefile

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...