#!/bin/sh # A simple but effective script to distribute commands to a cluster # Highlights the name of the node # # Create a file called nodes with the hostnames # Run something like ./distribute.sh yourcommand yourarg1 yourarg2 for I in `cat nodes`; do echo -e '\E[37;44m'"\033[1m"${I}"\033[0m" ssh $I "$@" echo done