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": "asleney0@nytimes.com"
}, {
"first_name": "Clint",
"last_name": "Ducroe",
"email": "cducroe1@aboutads.info"
}, {
"first_name": "Aurthur",
"last_name": "Tebb",
"email": "atebb2@fastcompany.com"
}]
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 "asleney0@nytimes.com"
Email address for user Clint Ducroe is "cducroe1@aboutads.info"
Email address for user Aurthur Tebb is "atebb2@fastcompany.com"
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
asleney0@nytimes.com
Clint
Ducroe
cducroe1@aboutads.info
Aurthur
Tebb
atebb2@fastcompany.com
*NB: the data comes from random generator, no real names or emails.