我从curl
命令中得到这种JSON
应答:
[
{
"cid": 49,
"pyn": "yi4",
"hans": "亿",
"hant": "億",
"tid": 68,
"l10n": "cent million",
"pid": 1,
"pos": "num",
"pos_txt": ""
},
{
"cid": 50,
"pyn": "yi4",
"hans": "亿",
"hant": "億",
"tid": 69,
"l10n": "100 millions",
"pid": 1,
"pos": "num",
"pos_txt": ""
}
]
如何使用Bash
或命令行(例如underscore
)计算数组中项目的数量(这里是2
) ?