shell script to compare two files and write the difference to third file
<p>I want to compare two files and redirect the difference between the two files to third one.<br>
file1:</p>

<pre><code>  /opt/a/a.sql
  /opt/b/b.sql
  /opt/c/c.sql
</code></pre>

<p>In case any file has <code>#</code> before <code>/opt/c/c.sql</code>, it should skip <code>#</code></p>

<p>file2:</p>

<pre><code> /opt/c/c.sql
 /opt/a/a.sql
</code></pre>

<p>I want to get the difference between the two files. In this case,  <code>/opt/b/b.sql</code> should be stored in a different file. Can anyone help me to achieve the above scenarios?</p>