For example:
echo '{"p":2}{"q":3}' | jq '.'
How do I select the first object? I want the object below:
{"p":2}
CodePudding user response:
You would use the -n command-line option, e.g.:
jq -n input
or
jq -n 'first(inputs)'
For example:
echo '{"p":2}{"q":3}' | jq '.'
How do I select the first object? I want the object below:
{"p":2}
CodePudding user response:
You would use the -n command-line option, e.g.:
jq -n input
or
jq -n 'first(inputs)'