Hi prassaad,
manipulations are :
1.to check how values such as 3333333(in above line )
changes every second i.e.after sleep(1);
2.how i will separate every values in above line...
That's still not very clear. I'll make some assumptions. Assuming that you want to pick the line with sda7, your script can just grep for sda7. To separate the elements of the line, you can use cut. Also, note that the fields in /proc/diskstats are separated by an unknown number of spaces, as in:
-
-
3 1 hda1 1282 2570 23 46
-
3 2 hda2 244191 3961445 2621545 20972360
-
3 64 hdb 11056 4657 473450 256563 60696 17135 623128 330075 0 150236 586641
-
3 65 hdb1 15595 472418 77894 623128
so you may need to "squash" them together to get a single space. Thus, if I wanted to extract the field immediately following "hda2" in the excerpt above, I might write:
- #! /bin/sh
-
while [ true ]
-
do
-
grep hda2 /proc/diskstats | tr -s ' ' | cut -d ' ' -f5
-
sleep 1
-
done
Without knowing any more than you have told us, that's about the best anyone can do for you.
HTH,
Paul