diff --git a/inxi b/inxi index 7dffe99..bafa2dd 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.1.5 +#### version: 1.1.6 #### Date: August 2 2009 ######################################################################## #### SPECIAL THANKS @@ -3076,25 +3076,27 @@ get_sensors_data() # we have to be sure we are working with the actual real string before assiging # data to real variables and arrays. Extracting C/F degree unit as well to use # when constructing temp items for array. + # note that because of charset issues, no tempUnit="°" tempWorkingUnit degree sign + # used, but it is required in testing regex to avoid error. /^(M\/B|MB|SYS)(.*)\+([0-9]+)(.*)[ \t°](C|F)/ && $2 ~ /^[ \t]*\+([0-9]+)/ { moboTemp=gensub( /[ \t]+\+([0-9\.]*)(.*)/, "\\1", 1, $2 ) tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) if ( tempWorkingUnit ~ /^C|F$/ && tempUnit == "" ){ - tempUnit="°" tempWorkingUnit + tempUnit=tempWorkingUnit } } /^CPU(.*)\+([0-9]+)(.*)[ \t°](C|F)/ && $2 ~ /^[ \t]*\+([0-9]+)/ { cpuTemp=gensub( /[ \t]+\+([0-9\.]+)(.*)/, "\\1", 1, $2 ) tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) if ( tempWorkingUnit ~ /^C|F$/ && tempUnit == "" ){ - tempUnit="°" tempWorkingUnit + tempUnit=tempWorkingUnit } } /^(P\/S|Power)(.*)\+([0-9]+)(.*)[ \t°](C|F)/ && $2 ~ /^[ \t]*\+([0-9]+)/ { psuTemp=gensub( /[ \t]+\+([0-9\.]+)(.*)/, "\\1", 1, $2 ) tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) if ( tempWorkingUnit ~ /^C|F$/ && tempUnit == "" ){ - tempUnit="°" tempWorkingUnit + tempUnit=tempWorkingUnit } } $1 ~ /^temp1$/ && $2 ~ /^[ \t]*\+([0-9]+)/ { @@ -3104,7 +3106,7 @@ get_sensors_data() } tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) if ( tempWorkingUnit ~ /^C|F$/ && tempUnit == "" ){ - tempUnit="°" tempWorkingUnit + tempUnit=tempWorkingUnit } } $1 ~ /^temp2$/ && $2 ~ /^[ \t]*\+([0-9]+)/ { @@ -3114,7 +3116,7 @@ get_sensors_data() } tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) if ( tempWorkingUnit ~ /^C|F$/ && tempUnit == "" ){ - tempUnit="°" tempWorkingUnit + tempUnit=tempWorkingUnit } } @@ -3127,7 +3129,7 @@ get_sensors_data() } tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) if ( tempWorkingUnit ~ /^C|F$/ && tempUnit == "" ){ - tempUnit="°" tempWorkingUnit + tempUnit=tempWorkingUnit } }