A Bash script I have been working on calls some processes in background. I have used "wait" in the parent Bash script to wait for all the background processes to finish. Runs fine.
However, the problem is with restart. I want that if any of the child process ends it should get started again. I tried a forever loop using using While and checking the process status using pgrep and issue restart. But that will consume resources.
Is there any other possibility to restart the child background process as soon as it stops/killed/terminates?