Created
April 18, 2019 02:05
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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