title: ssh wait for script to finish
body: <p>I am using  the following script to start a process on a node.
  from the main node:</p>
  
  <pre><code>for dir  in  n9 n18 n27 n40
  do
  
  node=compute-2-10
  
  ssh $node "cd $dir ; nohup ./process.sh &gt;  WATCHDOG-$dir &amp;"
  
  done
  </code></pre>
  
  <p>the thing is that when I connect to compute-2-10 I see no jobs running. I think that the problem is that the process can not be completed since bash doesn't wait for it to finish. Is this correct or do I need to do something else?</p>