Bitcoin: error parsing json in bashscript to send BTC using sendmany command
If this is your echo output:

'{"mj2FrDhEomSzyQtRoGY78oVRPcQs5L5o95":0.00001, "mkxnkT3kx9dsFS8V3qYydpL1o5F5MfwCvM":0.00001}'


Then you have too many quotes.  When you run echo, you should see:

{"mj2FrDhEomSzyQtRoGY78oVRPcQs5L5o95":0.00001, "mkxnkT3kx9dsFS8V3qYydpL1o5F5MfwCvM":0.00001}


That's because the shell strips off the outer set of quotes; it does that when you send the JSON to bitcoin-cli too.  Because you have the quotes there in the echo output, it implies that they're there in the bitcoin-cli command, so what you're sending Bitcoin Core looks like a JSON string rather than a JSON object.



This isn't asked in your question, but you might also want to look into the Debian/Ubuntu packages and commands named jshon and jq.  These help you process JSON in shell scripts.  Because they understand JSON, they tend to be a lot more robust the sed and awk.  I don't know if you need them for this script, however.