以下のようなやつ。
$ echo '{ "a": "1" }' '{ "b": "2"}' | jq
{
"a": "1"
}
{
"b": "2"
}
-s を使うと配列にできる
echo '{ "a": "1" }' '{ "b": "2"}' | jq -s
[
{
"a": "1"
},
{
"b": "2"
}
]
manにはこうかいてある
--slurp/-s:
Instead of running the filter for each JSON object in the
input, read the entire input stream into a large array and run
the filter just once.