I have a bash script that run a curl request and output the status via jq. I get the status as expected but when I compare the status it's always returning "non-equal" value, even if the value is equal (or seems so).
Here is the script:
status=( $(curl -H "Content-Type: application/json" -H "Authorization: Basic xxx==" -H "Cache-Control: no-cache" --data-binary "@$entry" $2/$3/_bulk_docs --silent | jq '.[0].status'))
echo $status
if [ "$status" = "409" ]
then
echo "Conflict"
else
echo "No Conflict"
fi
And it print 409 in the console as I expect.
I'm running this on a Windows 10 PC with Cygwin.
Thank's for further help!
409or in"409"?echo "<<$status>>"return in your script? Can you tell that.echo "<<$status>>"returns>>409