正常情况
[root@6A84935A18948CFB block]# cat /sys/block/sda/stat
3758907 4275 108729115 1307625 3883092 400210 101613393 6526928 0 2844355 5860981 0 0 0 0
使用 awk 去除多余空格
cat /sys/block/sda/stat | awk '{$1=$1;print}'
3756794 4251 108640459 1306792 3882578 400026 101600391 6526174 0 2843001 5860024 0 0 0 0
解析为 JSON 数组
cat /sys/block/sda/stat | awk '{$1=$1;print}' | xargs -I{} echo '"{}"' | jq 'split(" ")'
[
"3759352",
"4275",
"108744563",
"1307823",
"3884720",
"400364",
"101641859",
"6528584",
"0",
"2845230",
"5862519",
"0",
"0",
"0",
"0"
]