Ok, i admit, i never learned awk ... seems quite powerful, too
|
Quote:
|
I have started developing the script as said.
This is how my script looks. it takes the output of free -m and insert into a file for given amount of time. Code:
#!/bin/bash Code:
# ./test This can be done by taking col3/col2 but i m getting following error. Code:
# cat /tmp/raminfo | awk '{print $3/$2}' |
1) The error is probably coming from this line:
Code:
RAM Information for last 10 Seconds Code:
awk '/^Mem:/ { print $3 / $2}' /tmp/raminfo 3) Finally a suggestion/idea which is maybe just a matter of preference for me: when doing simple shell math, you could use i=$((i+1)) instead of i=$( expr $i + 1 ) if for no other reason than that there are three less characters to type :D but it's up to you. Cheers! |
Quote:
|
All times are GMT -5. The time now is 02:41 AM. |