我如何获得卷曲不显示进度条? [英] How do I get cURL to not show the progress bar?

查看:83
本文介绍了我如何获得卷曲不显示进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在脚本中使用卷曲并得到它的显示进度条。

我试过 -s -silent -S -quiet 选项,但他们没有工作。

下面是一个典型的命令我已经试过:

 卷曲-s http://google.com> temp.html

我只有它推到一个文件时,你得到的进度条,让卷曲-s http://google.com 没有一个进度条,但卷曲-s http://google.com> temp.html 一样。


解决方案

 卷曲-s http://google.com> temp.html

适用于在Ubuntu 9.10版本卷曲7.19.5(没有进度条)。但是,如果由于某种原因,它不是你的平台上工作,你总是可以将stderr重定向到/ dev / null的:

 卷曲http://google.com 2  - ;的/ dev / null的> temp.html

I'm trying to use cURL in a script and get it to not show the progress bar.

I've tried the -s, -silent, -S, and -quiet options, but none of them work.

Here's a typical command I've tried:

curl -s http://google.com > temp.html

I only get the progress bar when pushing it to a file, so curl -s http://google.com doesn't have a progress bar, but curl -s http://google.com > temp.html does.

解决方案

curl -s http://google.com > temp.html

works for curl version 7.19.5 on Ubuntu 9.10 (no progress bar). But if for some reason that does not work on your platform, you could always redirect stderr to /dev/null:

curl  http://google.com 2>/dev/null > temp.html

这篇关于我如何获得卷曲不显示进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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