Quote Originally Posted by bvz View Post
Ok, well at least line 11 is short enough that we can see it all.

Do you see where your script differs from mine in the line above? Line 10? The awk statement has a different mix of characters than the degree symbol.

Try running the following on the command line directly:

Code:
/usr/sbin/hddtemp /dev/sda | sed 's/\(.*\)://g' | awk -F '�' '{ print $1}')
This is just line 10 set up to run directly from the command line for disk sda. Other than substituting in the actual hddtemp command for the variable, and substituting in the sda drive for the variable, it is identical to what you posted. I suspect that the results of this command will not come back with an integer number. I suspect that that is because the original script was supposed to split the returned text on the degree symbol and throw away anything other than the first part (the part before the degree symbol). That is what awk does. If your script is looking for something other than the degree symbol, it won't split the line properly and you will get some extra cruft in there that should have been cut away.

A second question I have is about your line 2

You concatenate all your drives by saying /dev/sd[a-d]

That's pretty fancy. I've never done that before. Does that actually give you the correct array? Just wondering.
Line 10 was changed because of a previous comment somewhere in this thread that fixed another error I was getting.

Code:
frank@Server:~$ /usr/sbin/hddtemp /dev/sda | sed 's/\(.*\)://g' | awk -F '�' '{ print )1}'
-bash: syntax error near unexpected token `)'
About line 2 I saw it somewhere when I was googling my errors.