1

Looping in background issue

view story
linux-howto

http://www.unix.com – Background info : Linux machines, /bin/bash shell . I have several remote machines. I want to create a variable for each of these remote machines, by retrieving some data remotely for each of them. As this may take some time for each remote machine, I want to launch these commands woth a for command and to set in background each loop. Like this : Code: for machine in server1 server2 > do > eval ${machine}_nr=`ssh -q $machine "hostname"` > done & [1] 31891 After a second (the ssh commands are already finished) I press an enter and I get this in my prompt (some i (HowTos)