#!/bin/bash COMMAND=$1 for host in *{spg,sc,sw}*.sunet.se; do echo "Running command: $COMMAND on $host" ssh $host $COMMAND done