Okay this is very weird. I have two alert scripts (both .sh). One of them was working fine. I added a second slightly more complex one that never seemed to be called.
However when I commented the following line, it suddenly worked:
DIFF=$(( $CURRENTDATE - $MODIFICATIONDATE ))
I am completely at loss why that would be. Running things manually works fine. Enabling the line (even without any code using it further in the script) breaks the notification. Disabling it solves the notification.
Running "echo test1 > test.txt" before the DIFF does work. Running "echo test2 >> test.txt" after the DIFF never gets executed.
However when I commented the following line, it suddenly worked:
DIFF=$(( $CURRENTDATE - $MODIFICATIONDATE ))
I am completely at loss why that would be. Running things manually works fine. Enabling the line (even without any code using it further in the script) breaks the notification. Disabling it solves the notification.
Running "echo test1 > test.txt" before the DIFF does work. Running "echo test2 >> test.txt" after the DIFF never gets executed.
The problem was my $MODIFICATIONDATE variable being empty because I was using a relative path for the "stat" command which was supposed to be an absolute path. I am using "double-parentheses" fine with sh now.
Comment