I am running a simple command (some Kafka related stuff):
curl localhost:8083
Its output is very simple:
root@debian:/etc/kafka# curl localhost:8083/
{"version":"0.11.0.0-cp1","commit":"6a8cf706ddc9ab6a"}root@debian:/etc/kafka#
But now, when I use utility tool jq
to format json, more lines get added:
root@debian:/etc/kafka# curl localhost:8083/ | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 54 100 54 0 0 1492 0 --:--:-- --:--:-- --:--:-- 1500
{
"version": "0.11.0.0-cp1",
"commit": "6a8cf706ddc9ab6a"
}
Same happens if I pipe it to less
or cat
in the expected way curl ... | less
. So this has nothing to do with jq
itself.
My knowledge of all the stdin, stdout, stderr, pipes (that are just joins of stdout to sdtin), file redirects > < 2>
, etc.. doesn't explain this behaviour. :(
curl -q localhost:8083
curl
checks, if stdout is a TTY or a pipe and adapts its output according to it. So to shut it up you needcurl -s localhost:8083/
(-s for silent, not -q for quiet as I thought)