Reputation: 13735
The manual says
jq '.[2:4]'
"abcdefghi"
=> "cd"
But a run of jq
prints this:
$ jq '.[2:4]' <<< abcdefghi
parse error: Invalid numeric literal at line 2, column 0
Is the manual wrong? Or there is a bug in the program?
Upvotes: 1
Views: 46
Reputation: 52431
abcdefghi
is not a valid JSON string, but "abcdefghi"
is:
$ jq '.[2:4]' <<< '"abcdefghi"'
"cd"
If you look at the jq play example linked from the manual, you'll see the double quoted input.
Upvotes: 4