I have a JSON fragment.
The following does not work:
VALUE=<<PERSON
{
"type": "account",
"customer_id": "1234",
"customer_email": "[email protected]"
}
PERSON
echo -n "$VALUE" | python -m json.tool
The result is:
No JSON object could be decoded
Doing the same with jq, i. e.
echo -n "$VALUE" | jq '.'
There is no output.
There is the same behavior for the following:
VALUE=<<PERSON
'{
"type": "account",
"customer_id": "1234",
"customer_email": "[email protected]"
}'
PERSON
echo -n "$VALUE" | python -m json.tool
Response:
No JSON object could be decoded
But the following works:
VALUE='{
"type": "account",
"customer_id": "1234",
"customer_email": "[email protected]"
}'
echo -n "$VALUE" | jq '.'
echo -n "$VALUE" | python -m json.tool
echo $VALUEwithout... | jqwould be informative.