I want to use jq to put a stream of json objects into a json array, for example, from
{"a":1}
{"b":2}
to
[{"a":1},
{"b":2}]
But this would not work
echo '
{"a":1}
{"b":2}
'|jq '[.]'
since I got
[
{
"a": 1
}
]
[
{
"b": 2
}
]