#/bin/bash # Run this script to run the $command in all nodes ####### define your command here #command="hostname" #command="reboot now" command="ls -la /opt/" ####### define your command here coc-sshreachable hosts=$(cat /share/tmp/ssh-reachable.dat | awk '{if ($1 != "192.168.1.10") print $1}') for i in $hosts do ssh -X -Y -oStrictHostKeyChecking=no $i "$command" done