How to update json with variable array using bash script I have a json file test.json with below format: