0

我有点想实现这样的事情:
time (curl -s $url > /dev/null) >> out.txt
同时curl输出将被删除,我保存输出的时间

4

2 回答 2

1

尝试这个:

{ time curl -s &url ;} 2>> out.txt
于 2013-09-24T08:38:08.450 回答
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
于 2013-09-24T08:42:33.587 回答