Quantcast
Viewing all articles
Browse latest Browse all 520

Adding into each existing object within JSON array new values from file/variable/command using jq

I have json like this:

[    {"id": "1"    },     {"id": "2"    },     {"id": "3"    } ]

I call some "sizes.sh" that give me result:

102030

How can I update my original json with these results, so it will look:

[    {"id": "1","size": 10    },     {"id": "2","size": 20    },     {"id": "3","size": 30    }]

Viewing all articles
Browse latest Browse all 520

Trending Articles