i don't have hdtemp on my system but the following should give a clue:
[EMAIL PROTECTED] bascule]$ echo /dev/hda: IC350L40AVER07-0: 42C|gawk '{print 
$1,$3}'|sed 's/C//'
/dev/hda: 42
[EMAIL PROTECTED] bascule]$

bascule


On Thursday 04 Sep 2003 6:05 pm, Olaf Marzocchi wrote:
> I noticed hdparm is able to change the acoustic management value of HD (-Y
> flag) and my HD (IBM 60GXP 40 GB) is able to report it's temperature (I use
> hddtemp), so I decided it could be neat to have a script to set the HDspeed
> automatically, for example every 15 minutes.
>
> Unfortunately, I have never wrote scripts that deal with strings and I'm
> not able to extract the value of temperature and system load.
> hddtemp report this: "/dev/hda: IC350L40AVER07-0: 42C"
> and /proc/loadavg: 0.005 0.02 0.01 xxxxxx".
>
> I'd like to extract the temperature ("42") and the third value of system
> load (if I remember correctly, the first refers to the first minute, the
> second to 5 minutes and the third 15 minutes).
>
> I tried sed and gawk but without success.
>
> THX
> Olaf

-- 
"You're very sure of your facts, " he said at last, "I 
couldn't trust the thinking of a man who takes the Universe 
- if there is one - for granted. "


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to