For a specific reason I have to do an infinite loop inside a function and then run the function as a daemon,
#!/bin/sh
lol(){
while true
do
echo "looping..."
sleep 2
done
}
lol() &
that script doesn't work, it gives me the following error:
/tmp/test: line 9: syntax error: unexpected "&"
How do I do an infinite loop inside a function in ash
?