Python json.tool can be use this way in the shell command line to process JSON conent:
$ echo '{"x": 1}' | python -mjson.tool
{
"x": 1
}
Howerver, it seems it doesn't detect duplicated keys:
$ echo '{"x": 1, "x": 2}' | python -mjson.tool
{
"x": 2
}
Can be json.tool be used in a way (e.g. a flag/parameter) so duplicated keys are detected and an error is raised? Looking to documentation I haven't seen anything for that...
EDIT: this question is not a duplicate of the referred ones, as these questions deal with Python programs to detect duplicated keys while what I'm asking here is about using existing json.tool in shell commands line for that. However, the comments to the question has provided the answer (it is "no") so it's fine.