title: Function to process input from pipe
body: <p>I'm trying to write a bash-function to return a specific line of piped output by its number.
  Currently the full command looks like this:</p>
  
  <pre><code>mdfind 'my_search_string' | sed "2q;d"
  </code></pre>
  
  <p>That would return the 2nd line of output from the mdfind-command.</p>
  
  <p>I'm trying to turn <code>sed "$1q;d"</code> into a function that gets assigned as an alias.</p>
  
  <p>How can I process the piped input?</p>