rub handler should use -lt instead of < when checking number of rotations
at line 103 of the rub handler:
if [[ "$2" < 4 ]]; then error "Rotate: minimum of 4 rotations" exit 1 fi
this should read:
if [[ "$2" -lt 4 ]]; then error "Rotate: minimum of 4 rotations" exit 1 fi
I had the "days" variable set to 14, which when compared to 4 using the "<" operator does not evaluate as "less than". From the bash man page:
string1 < string2 True if string1 sorts before string2 lexicographically in the current locale.
"-lt" performs the correct numeric comparison. Again, from the man page:
arg1 OP arg2 OP is one of -eq, -ne, -lt, -le, -gt, or -ge. These arithmetic binary operators return true if arg1 is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to arg2, respectively. Arg1 and arg2 may be positive or negative integers.
Also, the error message might be changed to me more clear. Took me a little while to figure out that "Rotate: minimum of 4 rotations" was referring to the "days" variable in the rub config.
(from redmine: created on 2007-04-27, closed on 2007-06-19)