#!/bin/bash hosts=( <#list hosts as host> ${host} ) for host in <#noparse>${hosts[@]} do hostname=`ssh $host 'echo $HOSTNAME'` echo "$host $hostname" ssh $host 'bash -s' < stop.sh ${runtime.jarPath}/${info.name}.jar done