| |||||||||||||||||||||||||||||||
|
> fixed some bugs: > > echo `uptime|sed 's/.*up\s*\([0-9]*\).*/\1\/10+/';grep '^cpu > MHz' /proc/cpuinfo|awk '{print $4"/30+";}';free|grep '^Mem'|awk > '{print $3"/1024/3+"}';df -P -k -x nfs -x smbfs|awk '{if ($1 ~ > "/dev/(scsi| sd)"){ s+= $2} s+= $2;} END {print > s/1024/50"/15+70";}'`|sed 's/,/./'| bc|sed 's/\(..$\)/.\1cm/' As Neil sed, almost everything can be done with awk. Then, Willie said that the double count for devices is a bug. Thus: echo `uptime|awk '{print $3"/10+"}'; awk '/^cpu MHz/{print $4"/30+"}' /proc/cpuinfo; free|awk '/^Mem/{print $3"/1024/3+"}'; df -Pk -x nfs -x smbfs|awk 'NR>1{s+=$2} END{print s/1024/50"/15+70"}'`| bc|sed 's/.$/.&cm/' which shortens my length to 105.0cm >:-( -- gentoo-user mailing list
| ||||||||||||||||||||||||||||||
© 2004-2008 readlist.com