I am having the below json array and i wanted to append two additional key value pairs in the json array using bash. This is need to add dynamically on my existing json array file. Can somebody share some ideas on fixing this?
json array file :
[
{
"entry": "10.20.15.0/24",
"comment": "test ip1"
},
{
"entry": "10.20.16.0/24",
"comment": "test ip2"
}
]
additional key value pair I wanted to append,
{
"entry": "10.20.17.0/24",
"comment": "test ip3"
},
{
"entry": "10.20.18.0/24",
"comment": "test ip4"
}
so the final json array should look like as below,
[
{
"entry": "10.20.15.0/24",
"comment": "test ip1"
},
{
"entry": "10.20.16.0/24",
"comment": "test ip2"
},
{
"entry": "10.20.17.0/24",
"comment": "test ip3"
},
{
"entry": "10.20.18.0/24",
"comment": "test ip4"
}
]