title: how to fgrep/egrep exact string in a file
body: <p>I'm trying to search for an EXACT string match in a file. I know it can be done via "grep -w" but for some reason, i dont to do it with grep.</p>
  
  <p>Already tried these and didnt work for me:</p>
  
  <pre><code>egrep '\&lt; pattern \&gt;' file
  fgrep '\&lt; pattern \&gt;' file
  egrep '^pattern$' file
  fgrep '^pattern$' file
  </code></pre>
  
  <p>Example:</p>
  
  <p>I want to display only the line that contains exactly the "ABC100-10" string</p>
  
  <pre><code>$ cat file
  NULL1 VOID XX
  NULL2 VOID XX
  EMPTY VOID XX
  ABC100-10 VOID XX
  ABC100-102 VOID XX
  </code></pre>
  
  <p>When I try this:</p>
  
  <pre><code>egrep ABC100-10 file
  </code></pre>
  
  <p>Actual Output:</p>
  
  <pre><code>ABC100-10 VOID XX
  ABC100-102 VOID XX
  </code></pre>
  
  <p>Expected output</p>
  
  <pre><code>ABC100-10 VOID XX
  </code></pre>
  
  <p>With word boundaries:</p>
  
  <pre><code>egrep '\&lt;ABC100-10\&gt;' file
  </code></pre>
  
  <p>No output. Expected output:</p>
  
  <pre><code>ABC100-10 VOID XX
  </code></pre>
  
  <p>With start/end of line boundaries:</p>
  
  <pre><code>egrep '^ABC100-10$' file
  </code></pre>
  
  <p>No output. Expected output:</p>
  
  <pre><code>ABC100-10 VOID XX
  </code></pre>
  
  <p>By the way, I'm using Solaris 8. Any help would be appreciated.</p>