Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

Using jq how to correctly read a pair containing a backslash character?

$
0
0

I have a script with reading from json file in this way:

jq -c '.[]' input.json | while read pair; do   echo "$pair" | jq -r '.[0]'done;

The above throws `parse error: Invalid numeric literal at line 1, column 17` when input.json content is:

[    ["\\", "bslash.jpg"]]

This does not happen with other characters. Only on this, which is escaped.
How to correctly parse the content with jq?


Viewing all articles
Browse latest Browse all 657

Trending Articles