response=$(curl -sL -w \\n%{http_code} "http://<ip_addr>/api/1/app" -X DELETE)
echo response
if [ "$response" -eq 200 ]
then
echo "Got 200 OK"
else
echo "not getting the result"
fi
- What i'm trying to do is to get the http response code.
- I'm positive that the response should be 200 OK
When I run the script I'm getting
{ "result":true } 200 tst.sh: line 302: [: { 200: integer expression expectedI even don't want to display
{ "result":true }I just want to print 200 and compare 200.