Ticket #2292 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

pwmconfig v0.9

Reported by: ticket Owned by: khali
Priority: major Milestone: 3.0.1
Component: fancontrol Version: SVN
Keywords: Cc: vince@…

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

Changed 5 years ago 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?

Changed 5 years ago 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

Changed 5 years ago 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.

Note: See TracTickets for help on using tickets.