I have a JSON String in bash as follows.
sample='[{
"prTitle": "Revert some thing",
"name": "Some name"
}, {
"prTitle": "Revert \"Add logs for issue analysis\"",
"name": "Some name"
}]'
I need to process this json using jq as follows.
echo $sample | jq -c '.[]' | while read i; do
echo $i | jq -r '.prTitle'
done
But I am getting an error like
parse error: Invalid numeric literal at line 1, column 111
I understand that this error causing due to the quoted " inside the json string. But I just want a solution to process it in a right way.