[Bug 1572777] Re: fancontrol Error message if INTERVAL not an integer, bug if INTERVAL a negative non-integer

2016-04-20 Thread Randy
I think I've got a fix, by changing the test for a negative number to use [[ ]] and a regex to check for only positive numbers (with or without a decimal), and not zero (matching non-zero real numbers in one regex was getting messy). Using this: if ! [[ "$INTERVAL" != "0" && "$INTERVAL" =~

[Bug 1572777] Re: fancontrol Error message if INTERVAL not an integer, bug if INTERVAL a negative non-integer

2016-04-20 Thread Randy
I think I've got a fix, by changing the test for a negative number to use [[ ]] and a regex to check for only positive numbers (with or without a decimal), and not zero (matching non-zero real numbers in one regex was getting messy). Using this: if ! [[ "$i" != "0" && "$i" =~ ^[0-9]+([.][0-9]+)?$

[Bug 1572777] Re: fancontrol Error message if INTERVAL not an integer, bug if INTERVAL a negative non-integer

2016-04-20 Thread Randy
I think I've got a fix, by changing the test for a negative number to use [[ ]] and a regex to check for only positive numbers (with or without a decimal), and not zero (matching non-zero real numbers in one regex was getting messy). Using this: if ! [[ "$i" != "0" && "$i" =~ ^[0-9]+([.][0-9]+)?$