Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

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

$
0
0

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 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>