Ticket #2292 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

pwmconfig v0.9

Reported by: ticket Assigned to: khali
Priority: major Milestone: 3.0.1
Component: fancontrol Version: SVN
Keywords: Cc: vince@planetvince.info

Description

looks like bash tries to evaluate both parts of the "and" even tho the first returns false.

$ pwmconfig
,
,
,
Found the following PWM controls:
   hwmon0/device/pwm1
cat: hwmon0/device/pwm1_enable: No such file or directory
bin/pwmconfig: line 118: [: : integer expression expected
   hwmon0/device/pwm2
cat: hwmon0/device/pwm2_enable: No such file or directory
bin/pwmconfig: line 118: [: : integer expression expected

this is with using the new version (v 0.9) that you posted in response to my other ticket.

Change History

01/08/08 20:09:43 changed by khali

  • owner changed from somebody to khali.
  • status changed from new to assigned.

What version of bash is this? (and on which distribution?)

Is this problem new compared to the version of pwmconfig that comes with lm-sensors 3.0.0?

01/08/08 20:57:52 changed by ticket

GNU bash, version 3.1.17(1)-release (i686-redhat-linux-gnu) on Fedora Core 6. I removed the lm_sensors rpm(s) and installed lm_sensors v3.0.0 from your web site.

Yes this is new, v0.8 does not have this problem. it looks like the script was enhanced in this area. v0.8 only checked for the existance of the "$ENABLE" while v0.9 also checks for its value.

v

01/08/08 21:13:06 changed by khali

  • status changed from assigned to closed.
  • resolution set to fixed.

Oh well you're right, bash doesn't do lazy evaluation on test-like expressions. I really thought it did, my bad.

This is fixed in r5100, thanks for reporting.