I have a bash script that is intended to run a PHP script every 15 seconds, and a second PHP script every 5 minutes. However, my counter to do so is not working. I can't find where the bug is.
#!/bin/bash
while (true)
do
sleep 1
if (( count % 15 == 0 )) ;then
php test.php
fi
if (( count % 300 == 0 )); then
php test2.php
count=0
fi
(( count = count +1 ))
done
When I run this script, it gives me this error in the console:
script.sh: 8: script.sh: count: not found
script.sh: 11: script.sh: count: not found
script.sh: 16: script.sh: count: not found
script.sh: 8: script.sh: count: not found
script.sh: 11: script.sh: count: not found
script.sh: 16: script.sh: count: not found
I have tried to instantiate the counter prior to the loop, but it ends with the same result. Any help would be greatly appreciated!