brew install jq しましょう。まずはそれからだ。 ** JSON の整形 良くあるけど、どっかの API から雑なかんじで適当にインデントされた JSON が返却されたりして、JSONPath を書くにしろ、まずは整形しないと JSON の構造が分からん、みたいな悲しいことになって人類が不幸になる。 たとえばこんな JSON があるとして、見た瞬間ウッてなって開発者が一人不幸になる。 |tcsh| $ cat sample.json {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close"