- 论坛徽章:
- 0
|
数据
physicaldrive 3I:1:1 (port 3I:box 1:bay 1, SAS, 146 GB, OK)
physicaldrive 3I:1:2 (port 3I:box 1:bay 2, SAS, 146 GB, OK)
physicaldrive 3I:1:3 (port 3I:box 1:bay 3, SAS, 146 GB, OK)
physicaldrive 3I:1:4 (port 3I:box 1:bay 4, SAS, 146 GB, OK)
physicaldrive 4I:1:5 (port 4I:box 1:bay 5, SAS, 146 GB, OK)
physicaldrive 2E:1:1 (port 2E:box 1:bay 1, SATA, 750 GB, OK)
physicaldrive 2E:1:2 (port 2E:box 1:bay 2, SATA, 750 GB, OK)
physicaldrive 2E:1:3 (port 2E:box 1:bay 3, SATA, 750 GB, OK)
physicaldrive 2E:1:4 (port 2E:box 1:bay 4, SATA, 750 GB, OK)
physicaldrive 2E:1:5 (port 2E:box 1:bay 5, SATA, 750 GB, OK)
physicaldrive 2E:1:6 (port 2E:box 1:bay 6, SATA, 750 GB, OK)
physicaldrive 2E:1:7 (port 2E:box 1:bay 7, SATA, 750 GB, OK)
physicaldrive 2E:1:8 (port 2E:box 1:bay 8, SATA, 750 GB, OK)
physicaldrive 2E:1:9 (port 2E:box 1:bay 9, SATA, 750 GB, OK)
physicaldrive 2E:1:10 (port 2E:box 1:bay 10, SATA, 750 GB, OK)
physicaldrive 2E:1:11 (port 2E:box 1:bay 11, SATA, 750 GB, OK)
physicaldrive 2E:1:12 (port 2E:box 1:bay 12, SATA, 750 GB, OK)
想得到如下结果 SAS 146 GB 5 做一下硬盘数量的统计
SATA 750 GB 12
但是我写的awk -F"[,]" '{count[$3]++}END{for (disk in count)print $2,disk,count[disk]}' 这个有问题,应该是不能直接打印$2 ,而是应该打印$2数组中的元素,不过我数组这块学的不太明白,请教高手帮忙看看应该怎么写,学习一下。谢谢大家了。 |
|