title: How do I create an alias where the arguments go in the middle?
body: <p>I'm trying to define an alias where the arguments are inserted in the middle, instead of appended to the end.</p>
  
  <p>I tried defining it like this:</p>
  
  <pre><code>alias grep_logs="grep $1 */log/*.log"
  </code></pre>
  
  <p>where $1 is the first argument to grep_logs, such that:</p>
  
  <pre><code>grep_logs foo
  </code></pre>
  
  <p>would execute the following command:</p>
  
  <pre><code>grep foo */log/*.log
  </code></pre>
  
  <p>but instead, it runs the command:</p>
  
  <pre><code>grep foo */log/*.log foo
  </code></pre>
  
  <p>which results in the error:</p>
  
  <pre><code>grep: foo: No such file or directory
  </code></pre>
  
  <p>Is it possible to do this using an alias or do I need to define a function?</p>