My temp file.
{"label": "Allowed","value": "20863962"} ,
{"label": "Denied","value": "5"} ,
Read into an array.
#Read into array
IFS=$'\r\n' items=($(cat < ./tmp))
# print all items
echo "${items[@]}"
The output shows this:
{"label": "Allowed","value": "20863962"} , {"label": "Denied","value": "5"} ,
And my final curl command is failing.
When I run the script with -x, it is showing extra characters in the output which I suspect may be causing my final curl command to fail.
+ echo '{"label": "Allowed","value": "20863962"} ,' '{"label": "Denied","value": "5"} ,'
Note the extra ' ' in the echo output.
My final curl command should like this:
curl -d '{ "auth_token":"pass", "items": [{"label": "Allowed","value": "20863962"} , {"label": "Denied","value": "5"}] }' http://lab:3030/widgets/test