我从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": ""
}
]
我怎么能计算在数组(这里2)项目的数量,使用Bash或命令行(例如下划线)?