I have a curl cmd and return either one of json structure as below
#1
{
"keys": [
{
"key": "1234567890"
}
]
}
#2
{
"keys": [
"1234567890"
]
}
Shell/bash script (Mac)
key=$(curl "blah blah blah" | jq '??????')
what would be ????? look like to get the key by either one of json structure
billion thanks