There doesn't seem to be any way to output a flat list as a set of lines. Perhaps the -u option should handle flat lists this way, or we could have some other option, or even a jmespath function like 'echo' so that you could do something like:
jp 'foo.bar[] | echo(@)' -f foo.json
where foo.json like:
{
"foo": {
"bar": [
"bang",
"bling",
"baz"
],
"zow": ...
}
}
we would get:
which is suitable for bash loops and xargs and the like.
Apologies if I've missed what should have been an obvious way to achieve this.
There doesn't seem to be any way to output a flat list as a set of lines. Perhaps the -u option should handle flat lists this way, or we could have some other option, or even a jmespath function like 'echo' so that you could do something like:
where foo.json like:
we would get:
which is suitable for bash loops and xargs and the like.
Apologies if I've missed what should have been an obvious way to achieve this.