title: How to run a command in bash which captures the output and waits until the command has finished?
body: <p>I am using the following in a bash script:</p>
  
  <p><code>command &gt;&gt; /var/log/somelog.log 2&gt;&amp;1&amp;</code></p>
  
  <p>The reason I'm doing this is because I want to capture all output in <code>/var/log/somelog.log</code>.</p>
  
  <p>This works fine. <em>However</em> it does not wait until the command has finished. So that brings me to the question, how can I capture all output from <code>command</code> in <code>/var/log/somelog.log</code> <em>and</em> not have the bash script continue before <code>command</code> has finished?</p>