- 论坛徽章:
- 33
|
回复 16# fuyic
你的得到的“正确”结果是这样的吗?
# cat urfile
physicaldrive 3I:1:1 (port 3I:box 1:bay 1, SAS, 750 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)
|
- awk -F, '{a[$3]=$2;b[$3]++}END{for(i in a)print a[i],i,b[i]}' urfile
复制代码 SAS 146 GB 4
SATA 750 GB 13 |
|