title: How do I trim lines read from standard input on bash?
body: <p>I want a bash way to read lines from standard input (so I can pipe input to it), and remove just the leading and trailing space characters. Piping to echo does not work.</p>
  
  <p>For example, if the input is:</p>
  
  <pre><code>     12 s3c  
       sd wqr
  </code></pre>
  
  <p>the output should be:</p>
  
  <pre><code>12 s3c
  sd wqr
  </code></pre>
  
  <p>I want to avoid writing a python script or similar for something as trivial as this. Any help is appreciated!</p>