Issue
I have a very simple file, "retrieve4.sh"
Here is the full code:
while [ 1 ]
do
nohup php retrieve4.php 1 > /dev/null 2>&1 &
nohup php retrieve4.php 2 > /dev/null 2>&1 &
done
I keep getting the error
Syntax error: end of file unexpected (expecting "do")
Where am I going wrong?
Solution
If it should be an infinite loop try
while [ 1 = 1 ]
do
nohup php retrieve4.php 1 > /dev/null 2>&1 &
nohup php retrieve4.php 2 > /dev/null 2>&1 &
done
EDIT
while [ 1 ]
do
echo 'test'
done
This is running perfectly well on my setup. Therefore I'd expect your method of running the script is wrong
You could also try something like this:
while true ; do php my_script.php ; done > /dev/null
Answered By - Frnak