I'm running this command do get a value from the json;
addr=$(./xuez-cli getnetworkinfo | jq -r '.localaddresses[0].address')
and it works just fine.
BUT if this .localaddresses[0].address part empty or doesn't even exist, jq sets the addr variable as null like this; addr=null
and I want to check if the json is empty/null and run some other command instead of parsing it as null string.
I couldn't find a way to work this around. How can I do this?