我有点想达到这样的目的:
time (curl -s $url > /dev/null) >> out.txt
而 curl 输出将被删除,我保存时间的输出
答案 0 :(得分:1)
试试这个:
{ time curl -s &url ;} 2>> out.txt
答案 1 :(得分:1)
curl
提供了一个指定输出的选项:
-o, --output <file>
Write output to <file> instead of stdout. If you are using {} or
[] to fetch multiple documents, you can use '#' followed by a
number in the <file> specifier. That variable will be replaced
with the current string for the URL being fetched. Like in:
利用它,并说:
time curl -s $url -o /dev/null >> out.txt