I'd like to print with JQ arbitrary composed strings.
Suppose I have a json document* as follow:
[{
"first_name": "Angela",
"last_name": "Sleney",
"email": "[email protected]"
}, {
"first_name": "Clint",
"last_name": "Ducroe",
"email": "[email protected]"
}, {
"first_name": "Aurthur",
"last_name": "Tebb",
"email": "[email protected]"
}]
and with data from above let's say just for example (could be any string) I'd like to print with JQ 3 lines as follow:
Email address for user Angela Sleney is "[email protected]"
Email address for user Clint Ducroe is "[email protected]"
Email address for user Aurthur Tebb is "[email protected]"
How can I do this?
Best I was able to do was to print the data 1 per line with:
jq -r '.[] | .first_name, .last_name, .email, ""'
But result was
Angela
Sleney
[email protected]
Clint
Ducroe
[email protected]
Aurthur
Tebb
[email protected]
*NB: the data comes from random generator, no real names or emails.