Last updated 8 months ago
We can fix (23) Failed writing body error while piping cURL to some programs like grep by using an intermediate such as tac which by default reads line from last.
(23) Failed writing body
cURL
grep
tac
$ curl https://{SOME_URL} | tac | tac | grep {PATTERN}
Note: Using tac as it will first reverse the order, and then reverse it again to get the original body.
Source: