I'm trying to optimize some experiments with a Java application. The same application is on many machines. I want to run all of them via a bash script with ssh.
I have a bash script that has a while loop to run the application. Like this
while [ $COUNTER -lt $WORKERS ]
do
ssh ubuntu@host "java java-app.jar" > /data/some-logs.log
((COUNTER++))
((IP_BEGINS++))
done
However when I run the script I have to wait a moment and press Ctrl+C for every machine. How can I run every aplication on background?