作为一个单独的工具,它工作得很好:
curl "someURL"
curl -o - "someURL"
但这在流水线上行不通:
curl "someURL" | tr -d '\n'
curl -o - "someURL" | tr -d '\n'
它返回:
(23) Failed writing body
管道cURL输出的问题是什么?如何缓冲整个cURL输出,然后处理它?
作为一个单独的工具,它工作得很好:
curl "someURL"
curl -o - "someURL"
但这在流水线上行不通:
curl "someURL" | tr -d '\n'
curl -o - "someURL" | tr -d '\n'
它返回:
(23) Failed writing body
管道cURL输出的问题是什么?如何缓冲整个cURL输出,然后处理它?
当前回答
I was getting curl:(23)写作体不及格。后来我注意到我没有足够的空间通过curl下载rpm包,这就是我得到问题的原因。我腾出了一些空间和问题来解决。
其他回答
另一种可能是,如果使用-o(输出文件)选项,目标目录不存在。
如。如果你有-o /tmp/download/abc.txt且/tmp/download不存在。
因此,确保任何需要的目录都是预先创建/存在的,使用——create-dirs选项,必要时使用-o
我得到这个错误试图使用jq时,我没有安装jq。所以…如果您尝试使用jq,请确保已安装jq。
我添加了flag -s,它完成了任务。例如:curl -o- s https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
所以这是编码的问题。Iconv解决了这个问题
curl 'http://www.multitran.ru/c/m.exe?CL=1&s=hello&l1=1' | iconv -f windows-1251 | tr -dc '[:print:]' | ...
你可以这样做,而不是使用-o选项:
Curl [url] >[文件]