title: How to make a bash function which can read from standard input?
body: <p>I have some scripts that work with parameters, they work just fine but i would like them to be able to read from stdin, from a pipe for example, an example, suppose this is called read:</p>
  
  <pre><code>#!/bin/bash
  function read()
  {
   echo $*
  }
  
  read $*
  </code></pre>
  
  <p>Now this works with <code>read "foo" "bar"</code>, but I would like to use it as:</p>
  
  <pre><code>echo "foo" | read
  </code></pre>
  
  <p>How do I accomplish this?</p>