How to make a bash script that creates 40 simultaneous instances of a program?
问题 I am new to bash and Linux . I have a program I have written that I want to create multiple simultaneous instances of. Right now, I do this by opening up 10 new terminals, and then running the program 10 times (the command I run is php /home/calculatedata.php What is the simplest way to do this using a bash script? Also, I need to know how to kill the instances because they are running an infinite loop. Thanks!! 回答1: You can use a loop and start the processes in the background with & : for ((