首页 > 解决方案 > 用管道卷曲:如何在没有进度表的情况下打印错误?

问题描述

问题:命令后没有管道符号,curl命令的输出curlcurl: (21) QUOT command failed with 550.

使用管道符号,curl检测到它没有输出到终端并插入进度表。

要禁用进度表,我尝试使用该s标志,但是使用该s标志也可以防止curl: (21) QUOT command failed with 550输出。

我想curl继续以curl: (21) QUOT command failed with 550与在终端中输出相同的方式输出,但我不希望它输出进度表。

代码:(带s标志)

curl -ls -Q "DELE $remote_file" $remote_server | sed -r '/^\.{1,2}$/d'

额外信息:
也许这与问题无关:
代码:从输出sed中删除.和。..

更新:
使用的协议是ftp

标签: bashshellcurl

解决方案


您要查找的标志是-sS. 来自man curl

   -s, --silent
          Silent  or  quiet  mode.  Don't  show progress meter or error messages.  Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout
          unless you redirect it.

          Use -S, --show-error in addition to this option to disable progress meter but still show error messages.

          See also -v, --verbose and --stderr.

推荐阅读