title: Bash Script - tail to file
body: <p>I have the following in a bash script file watcher.sh.</p>
  
  <pre><code>grep ERROR $ExampleLogFile &gt; $ErrorLogFile
  </code></pre>
  
  <p>When I run this, it copied the lines from ExampleLogFile to ErrorLogFile that contain <code>ERROR</code> successfully.</p>
  
  <p>I need to make it so it continually monitors the ExampleLogFile for changes and writes those to the ErrorLogFile.</p>
  
  <p>I was thinking of doing the following, but this doesn't work:</p>
  
  <pre><code>tail -f grep ERROR $ExampleLogFile &gt; $ErrorLogFile
  </code></pre>
  
  <p>It does write some of the lines, but its not the ones containing <code>ERROR</code>.</p>
  
  <blockquote>
  <pre><code>tail: grep: No such file or directory
  tail: ERROR: No such file or directory
  </code></pre>
  </blockquote>
  
  <p>Any advise please.</p>