title: Linux shell pipe syntax
body: <p>I am implementing a program that simulates the Linux shell and I need to implement expressions with multiple pipes - but I am not sure what's considered legal or how to handle a few things, for example:</p>
  
  <ul>
  <li>Is pipe as the last character in the command legal? When I try it in the Linux shell it displays really weird behavior - after pressing enter it shows a new line with > in the beginning. I am not sure what does this mean as to the legality of the command?</li>
  <li>How to handle several consecutive pipes? For example ls -l ||||| grep 7
  it seems the shell just works as usual and ignores the redundant pipes but I am nit sure. Would like some help.</li>
  </ul>