title: Using cmp with process substitution (stdout)? (Bash)
body: <p>For our class, we had to make a C program that encodes MIPS instructions into instruction words and also decodes instruction words into MIPS instructions.</p>
  
  <p>I wrote everything already and tested on some cases, but I wanted to test it on a bigger dataset.</p>
  
  <p>We are given the test files: <code>test.asm</code> and <code>test.bin</code>.
  The <code>.asm</code> file has MIPS instructions and the <code>.bin</code> file has the equivalent instruction words for those MIPS instructions.</p>
  
  <p>My <code>decode</code> function takes in the instruction words from <code>test.bin</code>, converts them to equivalent MIPS instructions and sends it to <code>stdout</code>.</p>
  
  <p>I want to compare the output from my decode function with the MIPS instructions in the <code>test.asm</code> file to see that they are equivalent (that I decoded correctly).</p>
  
  <p>I was told that I could use the <code>cmp</code> command with process substitution to compare the two but I don't know what I would put inside the <code>&lt;(...)</code>.</p>
  
  <p>I run my program using: <code>bin/mips -d &lt; test.bin</code> where the <code>-d</code> flag represents <code>decoding</code>.</p>
  
  <p>I was thinking maybe it would be like this, but I'm not sure:</p>
  
  <p><code>cmp &lt;(cat test.asm) &lt;(bin/mips -d &lt; test.bin)</code></p>