Good day. You need to get the Zabbix configuration files. I send HTTP request from Bash a script. If you specify the host ID parameters directly using the testid variable, then everything works. If we specify the variable hostid, which takes the same symbols from the file, then I get the answer with a Json error. There are no extra spaces at the beginning and at the end. Please, push where to dig)
hostids=$(cat /var/lib/test/ids.txt) testid=\"10231\",\"10713\" curl -sS -X POST -H 'Content-Type: application/json-rpc' -d "{\"jsonrpc\": \"2.0\", \"method\": \"configuration.export\", \"params\":{\"options\":{\"hosts\":[$testid]},\"format\": \"json\"}, \"id\": 1, \"auth\": \"$token\"}" $zbxAPI -o /var/lib/test/conf_hosts.json