This question already has an answer here:
I want to execute a process on multiple servers. I am using the following wrapper script. The script moves to servers one at a time. I would like to change it so it can execute on multiple servers. Is there way to do it?
#!/bin/bash for ip in $(<ALL_SERVERS_IP); do # Tell the remote server to start bash, but since its # standard input is not a TTY it will start bash in # noninteractive mode. ssh -q "$ip" bash <<-'EOF' printf "%s\n" ================== "$(hostname) ::: Current date : $(date)" \ ================== ./remote EOF done