#!/bin/sh

while test $# -gt 0; do
  if test $# -eq 1; then
    command="$1"
  else
    hosts="${hosts} $1"
  fi
  shift 1
done

for host in ${hosts}; do
  ssh "${host}" "${command}"
done
