Google
 

Posts Tagged ‘CGI’

2008-09
12

one simple shell CGI script

Filed under: Tech articles — woojar @ 3:01 pm

Recently I want to learn further the shell programming. So just make the script to get the CPU usage rate.

#!/bin/bash
INPUT=/proc/stat
INTERVAL=1;

GetLoad(){
T2=`sed -n “1″p $INPUT |awk ‘{ print $2+$3+$4+$5+$6+$7+$8 }’`;
A2=`sed -n “1″p $INPUT |awk ‘{print $5}’`
}

GetLoad;
A1=$A2
T1=$T2
sleep… Continue reading

Tags: ,

Related posts

Page 1 of 11
36 queries. 1.570 seconds. Powered by WordPress
沪-ICP备07003363号 Stat.