Perhaps for that command bitcoin-cli requires to be passed quotation marks and the shell strips them away and only passes the string inside of them.
Maybe try adding a backslash to all of your quotation marks and if the bitcoin-cli requires to be passed a backslash for some quotation marks then add those with the double backslash as well.
Example:
Your command
./xbt-bitcoin.sh sendmany "" "{\"address1\":0.02,\"address2\":0.01}" 1 ""
might pass arguments to bitcoin-cli as this
.xbt-bitcoin.sh sendmany {"address1":0.02,"address2":0.01}" 1
The way it might work
.xbt-bitcoin.sh sendmany \"\" \"{\\\"address1\\\":0.02,\\\"address2\\\":0.01}\" 1 \"\"
Just and idea you can try.