I have variables with JSON:
export RESPONSE=$(curl -s --request POST --data "$some_data" $some_url)
In RESPONSE
{
"data": {
"warnings": "1",
"auth": "no"
... and a lot of variables
}
}
And I need to create variables how it:
$warnings="1"
$auth="no"
....
I only need variables from the field "data"
.
And in bash, as far as I understand, there is no to_entries
.
And yet, I need that the data from #RESPONSE is not written to the console while the script is running.
Update:
I have this working code but it writes all JSON to console and that's not what I want.
export ENV_SETTER=$(for i in $KEYS; do echo -n env.$i=$(echo $RESPONSE | jq -r .data.$i),;done)
Next i need this
--set "${ENV_SETTER}"