#/bin/bash
for i in `cat  servers.txt`; do echo $i;ssh $i $1; done

Following will execute the command df -h in all the servers listed in servers.txt

[root@server~]#sh all.sh ‘df -h’

Advertisements