How do I parse a json array of objects to a bash array with those objects as strings?
I am trying to do the following:
CONVO=$(get_json_array | jq '.[]')
for CONVERSATION in $CONVERSATIONS
do
echo "${CONVERSATION}"
done
But the echo prints out lines instead of the specific objects.
The format of the object is:
{ "key1":"value1", "key2": "value2"}
and I need to pass it to an api:
api_call '{ "key1":"value1", "key2": "value2"}'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…