¿Cómo consigo que cURL no muestre la barra de progreso?
Estoy tratando de usar cURL en un script y conseguir que no mostrar la barra de progreso.
He intentado -s
, -silent
, -S
, y -quiet
opciones, pero ninguna de ellas funciona.
He aquí un comando típico que he probado:
curl -s http://google.com > temp.html
Solo obtengo la barra de progreso cuando la envío a un archivo, por lo que curl -s http://google.com
no tiene una barra de progreso, pero curl -s http://google.com > temp.html
sí.
4 answers
curl -s http://google.com > temp.html
Funciona para la versión 7.19.5 de curl en Ubuntu 9.10 (sin barra de progreso). Pero si por alguna razón eso no funciona en tu plataforma, siempre puedes redirigir stderr a / dev / null:
curl http://google.com 2>/dev/null > temp.html
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-10 19:04:05
En curl versión 7.22.0 en Ubuntu y 7.24.0 en OSX la solución para no mostrar progreso pero para mostrar errores {[9] } es usar ambos -s
(--silent
) y -S
(--show-error
) así:
curl -sS http://google.com > temp.html
Esto funciona tanto para la salida redirigida > /some/file
, la salida canalizada | less
y la salida directamente al terminal para mí.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-01 19:04:43
Encontré que con curl 7.18.2 la barra de progreso de descarga no está oculta con:
curl -s http://google.com > temp.html
Pero es con:
curl -ss http://google.com > temp.html
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-08 18:54:56
No estoy seguro de por qué está haciendo eso. Intente -s
con la opción -o
para establecer el archivo de salida en lugar de >
.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-10 19:00:54