bash - 用管道卷曲:如何在没有进度表的情况下打印错误?
问题描述
问题:命令后没有管道符号,curl
命令的输出curl
是curl: (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
。
解决方案
您要查找的标志是-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.
推荐阅读
- python - 我将如何检查我的扫雷游戏的所有相邻单元格?
- itext7 - 在 CssContentPropertyResolver 中实现目标计数器
- graphql - 如何设置 mqtt 客户端永久收听主题?
- mysql - 这个 WordPress MySQL 数据库查询有什么问题?
- python - 试图在 python 中创建一个“折叠列表”?
- python - 以元编程方式使用 eval 为变量赋值
- c# - 修改 ObservableCollection 以省略重复的子值
- c# - 当表与自身具有多对多关系时,EF 6 从数据库获取父记录
- python - 是否有一个函数可以将 x 和 y 相加,其中 y 是熊猫系列中 x 之后的数字?熊猫中的 .shift()
- angular - 如何使用primeng将电话号码附加到角度5的国家代码