severity 341060 grave thanks (I am setting it back to grave so that apt-listbugs warns people off until an upload fixing the bug hits the archive. See the rest of the email).
On Mon, 28 Nov 2005, Martin Pitt wrote: > The script runs fine with bash and dash, and [ "$foo" ] is common Well, here it broke with bash from sid depending on the values of $foo, which is probably why you could not reproduce it. > practice and described in test(1: > > -n STRING > the length of STRING is nonzero > > STRING equivalent to -n STRING Braindamaged common practice, that one is. If with "-<something test recognizes>" the string is, stupid things test will do. Never use naked strings with test, it is courting an error mode. I *think* it is smart enough not to croak if you [ "$string" ], but it will on [ "$string" -a something -a "$string2" ]... In this case it barfs when some of the strings are "-1", see attached error dump. Try this: a=1 ; b=-1 ; [ -n "$a" -a "$b" ] && echo ok Interestingly enough, a=1 ; b=-1 ; [ "$a" -a "$b" ] && echo ok won't croak. This is bash trying to be smart, as a=1 ; b=-1 ; /usr/bin/[ "$a" -a "$b" ] && echo ok WILL croak. > Please give me the output of sh -nx /etc/init.d/sysfsutils if it > really breaks for you. "if it really breaks"? I'd have worded that request very differently, the way you did is not nice at all. I hope you did so because of the @d.o address, and would not write something like that to a regular user. Output attached, and sysfs.conf attached too. BTW, "-nx" gives no output, I ran it with -x only. also, just for completeness: khazad-dum:/etc# ls -lad /bin/sh lrwxrwxrwx 1 root root 4 Oct 14 19:47 /bin/sh -> bash and khazad-dum:/etc# head -n 1 /etc/init.d/sysfsutils #! /bin/sh -e -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh
# # /etc/sysfs.conf - Configuration file for setting sysfs attributes. # # The sysfs mount directory is automatically prepended to the attribute paths. # # Examples: # # Always use the powersave CPU frequency governor # devices/system/cpu/cpu0/cpufreq/scaling_governor=powersave # # Use userspace CPU frequency governor and set initial speed # devices/system/cpu/cpu0/cpufreq/scaling_governor = userspace # devices/system/cpu/cpu0/cpufreq/scaling_setspeed = 600000 ## ## ADM-1027 temperature monitor / fan controller ## # Device setup (maybe overriden later by /etc/sensors.conf) # Generated using sensors.conf, look there. class/i2c-adapter/i2c-0/device/0-002e/vrm = 91 class/i2c-adapter/i2c-0/device/0-002e/in0_max = 1576 class/i2c-adapter/i2c-0/device/0-002e/in0_min = 1419 class/i2c-adapter/i2c-0/device/0-002e/in1_max = 1523 class/i2c-adapter/i2c-0/device/0-002e/in1_min = 1301 class/i2c-adapter/i2c-0/device/0-002e/in2_max = 3472 class/i2c-adapter/i2c-0/device/0-002e/in2_min = 3128 class/i2c-adapter/i2c-0/device/0-002e/in3_max = 5260 class/i2c-adapter/i2c-0/device/0-002e/in3_min = 4740 class/i2c-adapter/i2c-0/device/0-002e/in4_max = 12625 class/i2c-adapter/i2c-0/device/0-002e/in4_min = 11375 ## Temperature control ## # temp1: CPU Temperature class/i2c-adapter/i2c-0/device/0-002e/temp1_min = 05000 class/i2c-adapter/i2c-0/device/0-002e/temp1_max = 80000 class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_off = 26000 class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_min = 45000 class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_max = 55000 class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_crit = 65000 # temp2: ADM1027 Temperature class/i2c-adapter/i2c-0/device/0-002e/temp2_min = 00000 class/i2c-adapter/i2c-0/device/0-002e/temp2_max = 60000 class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_off = 35000 class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_min = 35500 class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_max = 50000 class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_crit = 50000 # temp3: Motherboard (environment) Temperature class/i2c-adapter/i2c-0/device/0-002e/temp3_min = 00000 class/i2c-adapter/i2c-0/device/0-002e/temp3_max = 55000 class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_off = 35000 class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_min = 35500 class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_max = 50000 class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_crit = 60000 ## Fan and PWM control ## class/i2c-adapter/i2c-0/device/0-002e/auto_acoustics_enhancement = 2 # fan1: CPU fan class/i2c-adapter/i2c-0/device/0-002e/fan1_min = 2000 class/i2c-adapter/i2c-0/device/0-002e/pwm1_auto_channels = -1 # fan2: VR fan #class/i2c-adapter/i2c-0/device/0-002e/fan2_min = 1800 #class/i2c-adapter/i2c-0/device/0-002e/pwm2_auto_channels = -1 class/i2c-adapter/i2c-0/device/0-002e/fan2_min = 0 class/i2c-adapter/i2c-0/device/0-002e/pwm2_auto_channels = 0 # fan3: Front fan and fan4: Rear fan class/i2c-adapter/i2c-0/device/0-002e/fan3_min = 1000 class/i2c-adapter/i2c-0/device/0-002e/fan4_min = 1000 class/i2c-adapter/i2c-0/device/0-002e/pwm3_auto_channels = 23 class/i2c-adapter/i2c-0/device/0-002e/pwm3_auto_pwm_freq = 100 class/i2c-adapter/i2c-0/device/0-002e/pwm3_auto_pwm_min = 77 class/i2c-adapter/i2c-0/device/0-002e/pwm3_auto_pwm_minctl = 0
+ CONFFILE=/etc/sysfs.conf + '[' -r /etc/sysfs.conf ']' + case "$1" in + echo -n 'Setting sysfs variables...' Setting sysfs variables...+ sed 's/#.*$//; /^[[:space:]]*$/d; s/^[[:space:]]*\([^=[:space:]]*\)[[:space:]]*\([^=[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1 \2 \3/' /etc/sysfs.conf + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/vrm = mode -a 91 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/vrm = owner -a 91 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/vrm -a 91 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/vrm ']' + echo -n 91 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in0_max = mode -a 1576 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in0_max = owner -a 1576 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in0_max -a 1576 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in0_max ']' + echo -n 1576 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in0_min = mode -a 1419 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in0_min = owner -a 1419 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in0_min -a 1419 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in0_min ']' + echo -n 1419 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in1_max = mode -a 1523 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in1_max = owner -a 1523 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in1_max -a 1523 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in1_max ']' + echo -n 1523 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in1_min = mode -a 1301 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in1_min = owner -a 1301 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in1_min -a 1301 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in1_min ']' + echo -n 1301 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in2_max = mode -a 3472 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in2_max = owner -a 3472 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in2_max -a 3472 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in2_max ']' + echo -n 3472 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in2_min = mode -a 3128 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in2_min = owner -a 3128 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in2_min -a 3128 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in2_min ']' + echo -n 3128 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in3_max = mode -a 5260 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in3_max = owner -a 5260 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in3_max -a 5260 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in3_max ']' + echo -n 5260 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in3_min = mode -a 4740 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in3_min = owner -a 4740 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in3_min -a 4740 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in3_min ']' + echo -n 4740 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in4_max = mode -a 12625 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in4_max = owner -a 12625 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in4_max -a 12625 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in4_max ']' + echo -n 12625 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/in4_min = mode -a 11375 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in4_min = owner -a 11375 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/in4_min -a 11375 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/in4_min ']' + echo -n 11375 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_min = mode -a 05000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_min = owner -a 05000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_min -a 05000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp1_min ']' + echo -n 05000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_max = mode -a 80000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_max = owner -a 80000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_max -a 80000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp1_max ']' + echo -n 80000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_off = mode -a 26000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_off = owner -a 26000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_off -a 26000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_off ']' + echo -n 26000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_min = mode -a 45000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_min = owner -a 45000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_min -a 45000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_min ']' + echo -n 45000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_max = mode -a 55000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_max = owner -a 55000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_max -a 55000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_max ']' + echo -n 55000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_crit = mode -a 65000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_crit = owner -a 65000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_crit -a 65000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp1_auto_temp_crit ']' + echo -n 65000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_min = mode -a 00000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_min = owner -a 00000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_min -a 00000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp2_min ']' + echo -n 00000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_max = mode -a 60000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_max = owner -a 60000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_max -a 60000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp2_max ']' + echo -n 60000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_off = mode -a 35000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_off = owner -a 35000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_off -a 35000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_off ']' + echo -n 35000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_min = mode -a 35500 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_min = owner -a 35500 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_min -a 35500 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_min ']' + echo -n 35500 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_max = mode -a 50000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_max = owner -a 50000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_max -a 50000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_max ']' + echo -n 50000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_crit = mode -a 50000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_crit = owner -a 50000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_crit -a 50000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp2_auto_temp_crit ']' + echo -n 50000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_min = mode -a 00000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_min = owner -a 00000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_min -a 00000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp3_min ']' + echo -n 00000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_max = mode -a 55000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_max = owner -a 55000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_max -a 55000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp3_max ']' + echo -n 55000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_off = mode -a 35000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_off = owner -a 35000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_off -a 35000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_off ']' + echo -n 35000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_min = mode -a 35500 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_min = owner -a 35500 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_min -a 35500 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_min ']' + echo -n 35500 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_max = mode -a 50000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_max = owner -a 50000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_max -a 50000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_max ']' + echo -n 50000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_crit = mode -a 60000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_crit = owner -a 60000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_crit -a 60000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/temp3_auto_temp_crit ']' + echo -n 60000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/auto_acoustics_enhancement = mode -a 2 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/auto_acoustics_enhancement = owner -a 2 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/auto_acoustics_enhancement -a 2 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/auto_acoustics_enhancement ']' + echo -n 2 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/fan1_min = mode -a 2000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/fan1_min = owner -a 2000 -a '' ']' + '[' class/i2c-adapter/i2c-0/device/0-002e/fan1_min -a 2000 -a -z '' ']' + '[' -f /sys/class/i2c-adapter/i2c-0/device/0-002e/fan1_min ']' + echo -n 2000 + read f1 f2 f3 + '[' class/i2c-adapter/i2c-0/device/0-002e/pwm1_auto_channels = mode -a -1 -a '' ']' /etc/init.d/sysfsutils: line 18: [: -1: unary operator expected + '[' class/i2c-adapter/i2c-0/device/0-002e/pwm1_auto_channels = owner -a -1 -a '' ']' /etc/init.d/sysfsutils: line 24: [: -1: unary operator expected + '[' class/i2c-adapter/i2c-0/device/0-002e/pwm1_auto_channels -a -1 -a -z '' ']' /etc/init.d/sysfsutils: line 30: [: -1: unary operator expected + echo 'syntax error in /etc/sysfs.conf: '\''class/i2c-adapter/i2c-0/device/0-002e/pwm1_auto_channels'\'' '\''-1'\'' '\'''\''' syntax error in /etc/sysfs.conf: 'class/i2c-adapter/i2c-0/device/0-002e/pwm1_auto_channels' '-1' '' + exit 1 + echo done. done.