[font=¿¬Ìå_GB2312]×î½üдһ¸öshell ³ÌÐò£¬ÆäÖÐÓÐÒ»¸öÒªÇ󣬾ÍÊÇÒªÖ§³Öϵͳ·±Ã¦¼ì²â¡£Èô棬ÔòÍ£Ö¹£¬ÈôÏУ¬ÔòÔËÐС£
˵ʵ»°£¬ÕâÖÖËã·¨¿Ï¶¨±È½Ï¶à£¬ÒÔÏÂÊÇÎÒ¸öÈ˵ÄÒ»¸öСËã·¨¡£Ìù³öÀ´ºÍ´ó¼Ò·ÖÏí¡£
ÎÒ¾õµÃͦ²»ÂúÒâ¡£Ìù³öÀ´µÄÄ¿µÄ¾ø²»ÊÇìÅÒ«£¬Õâ²»ÊÇìÅÒ«µÄµØ·½£¬Ò²²»ÊÇìÅÒ«µÄ×ʱ¾£¬¶øÊÇÏ£ÍûºÍ´ó¼ÒÓÐËù½»Á÷£¬Ï£Íû¿´µ½¸üºÃµÄËã·¨¡£ÎÒ¼áÐÅÓиüºÃµÄËã·¨³öÏÖ¡£Íû´ó¼Ò¶àÌáÒâ¼ûºÍ½¨Ò飡[/font]
function busy()
{
touch cpu.txt;
echo -e "\033[31m \n Detecting the %idle of CPU ... \033[0m ";
export temp=1;
sar -u 1 3 | awk '{print$9}' | tail -n 4 >>cpu.txt ;
tail -n 4 cpu.txt | cut -d "." -f 1 | while read var;
do
#echo $var;
if [[ $var -ge 20 ]];then
delete; ### Run into delete function
exit;
fi
temp=$[ $temp + 1 ];
if [ $temp -eq 4 ];then
echo -e "\n \033[37;5m So sorry, System is busy now ! \n\033[0m ";
fi
done;
rm -rf cpu.txt;
}
gzxyong ÓÚ 2012-10-21 18:48:35·¢±í:
лл¥Ö÷£¡
ÓÚ 2012-10-07 12:41:43·¢±í:
Â¥Ö÷Ç«ÐéµÄ¾«ÉñÖµµÃѧϰ
Áõ³å ÓÚ 2012-08-29 23:21:15·¢±í:
»¶Ó¼¼ÊõÌû°¡£¬¿´ÁËÏ£¬»¹ÊDz»´íµÄ¡£
dhwoecv ÓÚ 2012-07-23 21:26:58·¢±í:
Ç¿