卷曲进度-仅显示百分比 [英] curl progress - only show percentage

查看:68
本文介绍了卷曲进度-仅显示百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

curl命令是否有一个选项,仅显示输出到shell的百分比而不是全部显示,例如:

Is there an option for the curl command to show only a percentage output to shell rather than all of this, for example:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.4M  100 12.4M    0     0  4489k      0  0:00:02  0:00:02 --:--:-- 4653k

也许我可以设置一个标志?如果不是,则通过正则表达式以某种方式将其传递给我,让我仅看到百分比的连续更新?

Maybe there is a flag I can set? If not, pipe it somehow through a regular expression to show me a continuous update of the percentage only?

谢谢所有

推荐答案

两个修饰符可能都可以帮助,尽管两者都不完全相同:-silent 将禁止所有更新,而 --progress-bar 仅显示进度条。

Two modifiers might help, although neither are exact: --silent will suppress all updates and --progress-bar will show a progress bar only.

编辑:一种简化操作的方法是使用期望可简化输出到您的shell脚本或任何正在监听curl的输出。

One option to make things easier would be to make a wrapper using Expect to simplify the output to your shell script or whatever is listening to curl.

这篇关于卷曲进度-仅显示百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆