问题描述
jq 总是在每个字段之间产生带有换行符/返回的输出:
jq ... foo.json
{
"Name": "stedolan","RecordTimestamp": "2021-02-25T05:00:06.740+0000"
}
如何让每条记录输出一行?
解决方法
jq 有一个选项:--compact-output
jq --compact-output ... foo.json
{"Name":"stedolan","RecordTimestamp":"2021-02-25T05:00:06.740+0000"}
全手册https://stedolan.github.io/jq/manual/v1.6/