簡體   English   中英

需要URL的響應時間和下載時間,並為它們編寫shell腳本

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

我有使用命令來獲取響應時間:

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

而且我還需要下面提到的js文件鏈接的下載時間,因此使用wget命令下載了此文件,但是我得到了多個參數。 我只需要下載時間

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

請建議

我認為您正在尋找的是:

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/^.*\=//'

說明:

2>&1> / dev / null | ->確保用stderr代替標准輸出

grep = ->選擇包含'='符號的行

sed's /^.*\\=//'- >刪除從linestart到=符號的所有內容

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM