How can I run an infinite loop in the background, while continuing on with the script's execution?
Example "script":
while true; do something_in_the_background; done
do_something_while_the_loop_goes_on_in_the_background
for 1 2 3; do somethingelse; done
exit 0
This (notice the &
) seems to crash the whole system after a short while:
while true; do
something_in_the_background &
done
do_something_while_the_loop_goes_on_in_the_background
for 1 2 3; do somethingelse; done
exit 0