I have like this json data in my case:
sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $LOGIN /bin/bash -s << EOT
echo "Saving to file.."
USER_DATA="{\"id\":"$USER_ID",\"sha\":"$USER_SHA"}"
echo "{\"id\":"$PRODUCT_ID",\"user\":"$USER_DATA"}" | jq -re > ~/user.json
EOT
When I tried save this json to file get error with message:
parse error: Unmatched '}' at line 1, column 21
How I can save correctly my json data to file?