json file as follows:
{"name" :"sam",
"age":23,
"designation":"doctor"}
now i want to add another json object {"location":"canada"} at the end of the file using bash script i have tried echo "{"location":"canada"}">>sample.json
but it results
{"name" :"sam",
"age":23,
"designation":"doctor"} {location:canada}
but i want it to be like this
{"name" :"sam",
"age":23,
"designation":"doctor",
"location":"canada"}
please suggest me