I have 8 javascripts which I start via node on my linux machine.
what I want is when a script is finished and closed itself it shall automatically restart.
Therefore I created a start.sh which looks like this
while true; do
node 1.js & node 2.js & node 3.js & node 4.js & node 5.js & node 6.js & node 7.js & node 8.js;
done
When i start it via ./start.sh alle the scripts start, but they dont automatically restart once they're finished.
Is there any thing i can add to the script itself that it restarts? I tried
while(true) {
//code//
}
but that restarts the script even if its not finished.