Skip to content

Instantly share code, notes, and snippets.

@olivierpierre
Last active August 4, 2016 21:05
Show Gist options
  • Save olivierpierre/fa8f9008fab07db7eced9dd1f01eda60 to your computer and use it in GitHub Desktop.
Save olivierpierre/fa8f9008fab07db7eced9dd1f01eda60 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
SCRIPT_RUN_SINGLE="/root/Xen_scripts/vm_run_cmd.sh"
if [ "$#" -lt 4 ]; then
echo "usage: $0 <prefix> <start> <stop> <cmd>"
exit
fi
for i in `seq $2 $3`; do
( ssh root@$1$i ${*:4} 2>&1 | sed "s/^/[$1$i] /" ) &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment