How to kick off a command parallel to a list of machines and monitor their result
Posted on 2008-10-23
I have posted a question few days ago for how to kick off a command (ssh $host "command...").
Someone suggest me to do the following:
for host in `cat /list/of/hosts`
ssh $host "some command" &
It is good. However, what do i need to do in the script to check whether the background process is complete before moving on the next step? Basically, I want each command is
complete (or the background process is complete) before moving to the next step.