Im executing a 'curl' operation and keeping the JSON response on a variable. Because I need to extract multiple values from this response I want to pass the variable to jq command instead of the curl operation (avoid multiple requests).
What I have tried so far:
JSON=$(curl ${URL})
#Test1
PARAM=$(JSON | jq -r '.param_one.val')
#Test2
PARAM=$( echo jq -r '.param_one.val' << "${JSON}" )
echo $PARAM #display result
How can I achieve this simple task?