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" =~
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]+)?$
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]+)?$