#! /bin/bash

#set -x

foreachpc()
{
  while  read HOST IP; do
    echo ssh "${HOST}=${IP}" $@
    
# start with closed stdin    
    ssh "${IP}"  $@ <<EOF
EOF
  done
}

sinfo --hostsandipmode --quiet | foreachpc $@

