Can anybody please help with the following script source code?
I have a script which is executed every 15 mins via a Crontab entry. In the script I set a counter initially to zero. If a particular file exists, I read the counter value stored. If it equals 3 I set it to zero. If the counter is zero then I display a message. I then increment the counter and write it to the log file. This, hopefully, will mean a message every 1hr.
When I try to run the script I get the following error message;
[red][0: not found[/red]
which refers to the line in the following source code indicated as "<--- Error"
I have a script which is executed every 15 mins via a Crontab entry. In the script I set a counter initially to zero. If a particular file exists, I read the counter value stored. If it equals 3 I set it to zero. If the counter is zero then I display a message. I then increment the counter and write it to the log file. This, hopefully, will mean a message every 1hr.
When I try to run the script I get the following error message;
[red][0: not found[/red]
which refers to the line in the following source code indicated as "<--- Error"
Code:
integer AI_NUM=0
#if [ -f $AI_LOG_FILE ]; then
# AI_NUM=`cat $AI_LOG_FILE`
# if [$AI_NUM -eq 3]; then
# AI_NUM=0
# fi
#fi
if [$AI_NUM -eq 0]; then <------ Error!!
echo "My Message"
fi
echo $AI_NUM + 1 > $AI_LOG_FILE