简体   繁体   English

需要URL的响应时间和下载时间,并为它们编写shell脚本

[英]Need response time and download time for the URLs and write shell scripts for same

I have use command to get response time : 我有使用命令来获取响应时间:

curl -s -w "%{time_total}\n" -o /dev/null https://www.ziffi.com/suggestadoc/js/ds.ziffi.https.v308.js

and I also need download time of this below mentioned js file link so used wget command to download this file but i get multiple parameter out put. 而且我还需要下面提到的js文件链接的下载时间,因此使用wget命令下载了此文件,但是我得到了多个参数。 I just need download time from it 我只需要下载时间

$ wget --output-document=/dev/null https://www.ziffi.com/suggestadoc/js/ds.ziffi.https.v307.js

please suggest 请建议

I think what you are looking for is this: 我认为您正在寻找的是:

wget --output-document=/dev/null https://www.ziffi.com/suggestadoc/js/ds.ziffi.https.v307.js 2>&1 >/dev/null | grep = | awk '{print $5}' | sed 's/^.*\=//'

Explanation: 说明:

2>&1 >/dev/null | 2>&1> / dev / null | --> Makes sure stderr gets piped instead of stdout ->确保用stderr代替标准输出

grep = --> select the line that contains the '=' symbol grep = ->选择包含'='符号的行

sed 's/^.*\\=//' --> deletes everything from linestart to the = symbol sed's /^.*\\=//'- >删除从linestart到=符号的所有内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM