title: Convert my bash command into a bashrc function and pass argument
body: <p>I've got a sweet bash command to find key phrases in files and filepaths, <a href="https://stackoverflow.com/a/12865286/318090">thanks to @ezod here</a>. I'm trying to turn it into a function in my bashrc, but it doesn't generate the same result. I'm guessing it's related to back-to-back curly brackets that I need to escape or use an alternative method?</p>
  
  <p><strong>Works:</strong></p>
  
  <pre><code>{ find . -name '*keyword*'; grep -irl 'keyword' .; } | sort -u
  </code></pre>
  
  <p><strong>Does not work in bashrc:</strong></p>
  
  <pre><code>function findit() {
    { find . -name '*$1*';
      grep -irl '$1' .;
    } | sort -u
  }
  export -f findit
  
  $ findit keyword
  </code></pre>