I am writing a shell script in which I need to work on the response of an api. I called the api using curl command and trying to get its response in shell so that I can loop over response and print it. But I am not able to get the response. Here is the script:
#!/bin/bash
result=$(curl "https://example.com/test")
echo "test"
RESP=`echo $result | grep -oP "^[^a-zA-Z0-9]"`
echo "$RESP"
I am getting empty response after test. Can somebody help me over this ?
echo "${result}"...echo "$result"and let us know then.