I am working on a script that has to process a lot of data. All comes down to 3 commands. I use:
#!/bin/csh gnome-terminal -e "ssh $servername1 'command 1'" & gnome-terminal -e "ssh $servername2 'command 2'" command 3
I now have to wait for command 1 and 2 to finish, before starting command 3. I have tried using 'wait' and 'pid', although i cannot get it to wait. It looks like my scripts sees the command as done, when the gnome-terminal has opened.