I have 2 arrays in 2 files and I'm trying to multiply them using JQ.
file1.json:
[
{"a": "1", "b": "2"},
{"a": "3", "b": "4"}
]
file2.json:
[
{"x": "10", "y": "12", "z": "15"},
{"x": "20", "y": "22", "z": "25"}
]
and the expected output:
[
{"a": "1", "b": "2", "x": "10", "y": "12", "z": "15"},
{"a": "1", "b": "2", "x": "20", "y": "22", "z": "25"},
{"a": "3", "b": "4", "x": "10", "y": "12", "z": "15"},
{"a": "3", "b": "4", "x": "20", "y": "22", "z": "25"}
]
When I do jq .[0] * .[1] file1.json file2.json it says
array ... and array ... can't be multiplied