how to run multiple shell scripts in parallel
- by tom smith
I've got a few test scripts, each of which runs a test php app.
Each script runs forever.
So, cat.sh, dog.sh, and foo.sh, each run a php script, and each shell script runs the php app in a loop, so it runs forever, sleeping after each run.
I'm trying to figure out how to run the scripts in parallel, and at the same time, see the output of the php apps in the stdout/term window.
I thought, simply doing something like
foo.sh > &2
dog.sh > &2
cat.sh > &2
in a shell script would be sufficient, but it's not working.
foo.sh, runs foo.php once, and it runs correctly
dog.sh, runs dog.php in a never ending loop. it runs as expected
cat.sh, runs cat.php in a never ending loop
*** this never runs!!!
it appears that the shell script never gets to run cat.sh. if i run cat.sh by itself in a separate window/term, it runs as expected...
thoughts/comments