Skip to content

Instantly share code, notes, and snippets.

@peppy
Created March 25, 2014 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peppy/9754242 to your computer and use it in GitHub Desktop.
Save peppy/9754242 to your computer and use it in GitHub Desktop.
Run a command on all servers listed (space separated)
#!/bin/bash
SERVERS=""
for host in $SERVERS
do
echo -e "------------------------------------------------------"
echo -e "Running on \x1B[96m$host\x1B[0m"
echo -e "------------------------------------------------------"
ssh $host $@
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment