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

How to control jq error message when input is not valid json?

$
0
0

jq prints error message like the following when the input is invalid.

$ jq . <<< "xxx"parse error: Invalid numeric literal at line 2, column 0

I want to control what is printed when the input json is not valid. For example, I may want to prepend something to the original error message. How can I achieve this with jq?

XXX:parse error: Invalid numeric literal at line 2, column 0

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>