When I running jq command locally it works:
jq --arg ip "$IP" '.nodes|.app|.ip = $ip' nodes.json
Output:
{ "nodes": 1, "is_manager": true, "ip": "127.0.0.1", "cpus": 16, "memory": 64 }
But I can't figure out how do I send it remotely via ssh, for example this command returns an error:
ssh -o StrictHostKeyChecking=no -i key.pem user@"172.13.1.23" "jq --arg ip "127.0.0.1" '.nodes|.app|.ip = $ip' nodes.json"
Output:
jq: error: syntax error, unexpected $end (Unix shell quoting issues?) at , line 1: .nodes|.app|.ip = jq: 1 compile error