I have a bash while do done loop in a loop that outputs using this
echo "${KEY}: {\"${ATTRIBUTE}\": ${VALUE} }"
Input part 1
"PKEY1": {"rank": 1 }
"PKEY2": {"rank": 2 }
"PKEY3": {"rank": 4 }
"PKEY4": {"rank": 3 }
Input part 2
"PKEY1": {"attr": "xyz" }
"PKEY2": {"attr": "foo" }
"PKEY3": {"attr": "bar" }
"PKEY4": {"attr": "abc" }
Input part 3,4,5,etc...
How can I get an output file or echo to look like this in short
{
"PKEY1": {"rank": 1, "attr": "xyz" },
"PKEY2": {"rank": 2, "attr": "foo" },
"PKEY3": {"rank": 4, "attr": "bar" },
"PKEY4": {"rank": 3, "attr": "abc" }
}