title: zsh Looping through multiple parameters
body: <p>In my old <code>.bashrc</code>, I had a short section as follows:</p>
  
  <pre><code>PATH2ADD_SCRIPTBIN="/home/foo/bar/scriptbin"
  PATH2ADD_PYTHONSTUFF="/home/foo/bar/pythonprojects"
  
  PATH2ADDLIST="$PATH2ADD_SCRIPTBIN $PATH2ADD_PYTHONSTUFF"
  
  for PATH2ADD in $PATH2ADDLIST; do
  
      if [ -z `echo $PATH | grep "$PATH2ADD"` ]; then
  
          export PATH=$PATH:$PATH2ADD
          echo "Added '$PATH2ADD' to the PATH."
  
      fi
  
  done
  </code></pre>
  
  <p>And in Bash, this worked just as intended: it appended the paths I included in <code>$PATH2ADDLIST</code> if they were not already present in the path (I had to do this after realizing how huge my path was getting each time I was sourcing my <code>.bashrc</code>). The output (when the provided paths were not already present) was as follows:</p>
  
  <pre><code>Added '/home/foo/bar/scriptbin' to the PATH.
  Added '/home/foo/bar/pythonprojects' to the PATH.
  </code></pre>
  
  <p>However, I recently switched over to the magical land of <code>Zsh</code>, and the exact same lines of text now produce this result:</p>
  
  <pre><code>Added '/home/foo/bar/scriptbin /home/foo/bar/pythonprojects' to the PATH.
  </code></pre>
  
  <p>Now I'm pretty sure that this is because of some difference in how <code>Zsh</code> does parameter expansion, or that it has something to do with how <code>Zsh</code> changes the <code>for</code> loop, but I'm not really sure how to fix this.</p>
  
  <p>Might anyone have some insight?</p>