title: How to define a function on one line
body: <p>Often when moving files around, I need to do the opposite later. So in my .bashrc I included this working code:</p>
  
  <pre><code>rmv() {
    mv $2/${1##*/} ${1%/*}
  }
  </code></pre>
  
  <p>Now I wonder why I can't write this as a single liner. This is what I tried:</p>
  
  <pre><code>rmv() {mv $2/${1##*/} ${1%/*}}
  </code></pre>
  
  <p>If I do so, I get this error:</p>
  
  <pre><code>-bash: .bashrc: line 1: syntax error near unexpected token `{mv'
  </code></pre>