title: what is the difference between piping and running commands sequentially?
body: <p>run is a file that processing an input from stdin and outputs a result on stdout</p>
  
  <p>when I write: </p>
  
  <pre><code>$ ./run &lt; in.json &gt; actual.json 
  $ diff out.json actual.json 
  </code></pre>
  
  <p>I get that there is no difference </p>
  
  <p>so when I write: </p>
  
  <pre><code>$ ./run &lt; in.json &gt; actual.json | diff out.json actual.json
  </code></pre>
  
  <p>I expect that it returns that there is no difference 
  but instead I get that there is a difference which is everything in out.json </p>
  
  <p>What is the difference between those two commands? From my understanding piping (|) executes the command on the left then the command on the right so they should be the same commands</p>