Skip to content

Instantly share code, notes, and snippets.

@hackprime
Created April 18, 2019 02:05
Show Gist options
  • Save hackprime/da9d2138dc4acf70b257e33181a34891 to your computer and use it in GitHub Desktop.
Save hackprime/da9d2138dc4acf70b257e33181a34891 to your computer and use it in GitHub Desktop.
Simple shortcut to execute a command on hosts with similar names via ssh
for i in {01..20}; do echo "[my-cluster-$i]"; sshpass -p 'pass' ssh -o "StrictHostKeyChecking no" my-cluster-$i 'ps aux' | grep mpirun; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment