title: Waiting for wine to finish running
body: <p>My current script looks like this:</p>
  
  <pre><code>cd ~/.wine/drive_c/
  echo "test123" &gt; foo$$.txt
  wine start "C:\foo$$.txt"
  wineserver -w
  echo "Wine is done!"
  </code></pre>
  
  <p>which works fine when only one program is running in wine at a time. However if I run this a second time, before the first program is done, both scripts will wait for each others programs to exit.</p>
  
  <p>This does not work:</p>
  
  <pre><code>cd ~/.wine/drive_c/
  echo "test123" &gt; foo$$.txt
  $(wine start "C:\foo$$.txt") &amp;
  wait ${!}
  echo "Wine is done!"
  </code></pre>
  
  <p>as it will exit before you close the text editor.</p>
  
  <p>I need to use the <code>start</code> command, because I want a file to be run with its default editor/viewer.</p>