问题:
Is there a (Unix) shell script to format JSON in human-readable form? 是否有(Unix)Shell脚本以易于理解的格式格式化JSON?
Basically, I want it to transform the following: 基本上,我希望它可以转换以下内容:
{ "foo": "lorem", "bar": "ipsum" }
... into something like this: ...变成这样:
{
"foo": "lorem",
"bar": "ipsum"
}
解决方案:
参考一: https://stackoom.com/question/1Tb0/如何在Shell脚本中漂亮地打印JSON参考二: https://oldbug.net/q/1Tb0/How-can-I-pretty-print-JSON-in-a-shell-script
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4458136