title: Why does this one-line function work in zsh but not bash, and how can I fix it for bash?
body: <p>I figured out the answer as I was researching how to phrase the question, but it may be useful for somebody. I use zsh and both my .zshrc and my .bashrc have <code>source $HOME/.alias</code> in them. Here is the old, problematic <code>~/.alias</code></p>
  
  <pre><code>rl() { grep -v "$1" "$2" &gt; /tmp/rl.txt &amp;&amp; mv /tmp/rl.txt "$2" }
  ...
  </code></pre>
  
  <p>It worked fine in zsh, but in bash I got an unexpected end of file error, and <code>rl</code> was undefined.</p>