I am using a script to connect to multiple servers. At the moment, I am using something like:
for SERVER in server1 server2 server3 ; do ssh $SERVER "my-command" ; done
I have to specify the (many) servers every time. I was wondering if there is a better way, for example if ssh has any possibility to define "groups of servers", so that I could refer to it as
for SERVER in $SERVERLIST ; do ssh $SERVER "my-command" ; done
or is this a bad idea, and should be done in bash instead?