AIXSolarisAdmin
MIS
I have iostat output in a file and need a cumulative total for each device (there may be a few or there could be tens of devices).
for example:
This can be done like this in awk using:
How can this be done using C to get output like:
for example:
Code:
sdy 1.0
sdz 1.0
sdy 17.5
sdz 12.1
sdy 5.33
sdz 0.3
This can be done like this in awk using:
Code:
awk '{await[$1]+=$10}END{for(j in await)print j" "await[j]}' x
How can this be done using C to get output like:
Code:
sdy 19.18
sdz 14.19