mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
found the bug, gawk creates an array item if you test for its presence using array[1] != "" even when it didn't exist, bad gawk, bad
This commit is contained in:
parent
0b3c6a6bdc
commit
64aa40b175
12
inxi
12
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.0.105-b1
|
#### version: 1.0.106-b1
|
||||||
#### Date: 28 July 2009
|
#### Date: 28 July 2009
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -3013,7 +3013,6 @@ get_sensors_data()
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
|
||||||
local sample="
|
local sample="
|
||||||
|
|
||||||
"
|
"
|
||||||
# echo "$sample"| gawk -v userCpuNo="$SENSORS_CPU_NO" '
|
# echo "$sample"| gawk -v userCpuNo="$SENSORS_CPU_NO" '
|
||||||
|
|
||||||
|
@ -3182,13 +3181,14 @@ local sample="
|
||||||
else {
|
else {
|
||||||
moboTempReal=temp2
|
moboTempReal=temp2
|
||||||
}
|
}
|
||||||
|
|
||||||
# then set the cpu fan speed
|
# then set the cpu fan speed
|
||||||
if ( aFanReal[1] == "" ) {
|
if ( aFanReal[1] == "" ) {
|
||||||
if ( tempFanType == 1 && aFanWorking[1] != "" ) {
|
# note, you cannot test for aFanWorking[1] or [2] != ""
|
||||||
|
# because that creates an array item in gawk just by the test itself
|
||||||
|
if ( tempFanType == 1 && 1 in aFanWorking ) {
|
||||||
aFanReal[1]=aFanWorking[1]
|
aFanReal[1]=aFanWorking[1]
|
||||||
}
|
}
|
||||||
else if ( tempFanType == 2 && aFanWorking[2] != "" ) {
|
else if ( tempFanType == 2 && 2 in aFanWorking ) {
|
||||||
aFanReal[1]=aFanWorking[2]
|
aFanReal[1]=aFanWorking[2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3213,8 +3213,6 @@ local sample="
|
||||||
indexCountaFanWorking=i
|
indexCountaFanWorking=i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "icafw: " indexCountaFanWorking
|
|
||||||
print "icafr: " indexCountaFanReal
|
|
||||||
|
|
||||||
# clear out any duplicates. Primary fan real trumps fan working always if same speed
|
# clear out any duplicates. Primary fan real trumps fan working always if same speed
|
||||||
for (i = 1; i <= indexCountaFanReal; i++) {
|
for (i = 1; i <= indexCountaFanReal; i++) {
|
||||||
|
|
Loading…
Reference in a new issue