I have this input
[{"email":"etu@etu"},{"email":"hg"},{"email":"ismail"}]
and I want to extract only the value on the email using bash.
I have this input
[{"email":"etu@etu"},{"email":"hg"},{"email":"ismail"}]
and I want to extract only the value on the email using bash.
Simply with jq
:
echo '[{"email":"etu@etu"},{"email":"hg"},{"email":"ismail"}]' | jq -r '.[].email'
The output:
etu@etu
hg
ismail
I recommend you use some unix tool for this and invoke it in your bash process.
Check this out: json command line processor
You probably want to investigate this one and you'll be probably good to go.