Created
November 8, 2017 09:49
-
-
Save seancheung/cbe3f27fd47de061dbe740d88fd2589e to your computer and use it in GitHub Desktop.
exec commands on multiple remotes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=$(whoami) | |
declare -a HOSTS=( | |
hostname1 | |
hostname2 | |
hostname3) | |
for i in "${HOSTS[@]}" | |
do | |
ssh "$USERNAME"@"$i" "$1" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment