I have a Python script lets call it foo.py
and I need to execute this first. After this script is finished executing I have to run about 10 Java JAR files (lets call it waldo.jar
). I want to save time and have them run concurrently. How do I replicate this function in a shell script?
I have this so far:
#!/bin/bash
cd /root
python3 foo.py 1> output.txt
java -jar waldo.jar fooArg barArg & # Jar 1
java -jar waldo.jar fooArg2 barArg2 & # Jar 2
java -jar waldo.jar fooArg3 barArg3 & # Jar 3
... and so on
echo "All Finished!"
I need those jar files running at the same time in the background.