#jq コマンドで配列を解除してまた囲む例


Failed

this case make three JSONs

$ echo '[1,2,3]' | jq '.[] | [.]'                                                                                                            1
[
  1
]
[
  2
]
[
  3
]

Success

It makes one JSON has one whole array has multiple elements

$ echo '[1,2,3]' | jq '[.[]]'                                                                                                                1
[
  1,
  2,
  3
]

Original by Github issue