#!/usr/bin/env sh

COMMAND="${1}"
shift

while [ "${#}" -gt 0 ]; do
  printf '%40s\r%s\n' ''  "${1}" | tr ' ' '-'
  [ "${1}" = "local" ] && { bash -c "${COMMAND}"; true; } || ssh -t "${1}" "${COMMAND}"
  shift
done