title: zsh: parameter expansion inserting quotes
body: <p>I'm having trouble during parameter expansion in zsh: It's enclosing my variable in quotes.</p>
  
  <p>Here is my script. (Apologies for the noise, the only real important line is the last one with the <code>find</code> call, but I wanted to make sure I'm not hiding details of my code)</p>
  
  <pre class="lang-bsh prettyprint-override"><code>    #broken_links [-r|--recursive] [&lt;path&gt;]
      # find links whose targets don't exist and print them. If &lt;path&gt; is given, look
      # at that path for the links. Otherwise, the current directory is used is used.
      # If --recursive is specified, look recursively through path.
      broken_links () {
          recurse=
          search_path=$(pwd)
  
          while test $# != 0
          do
                  case "$1" in
                          -r|--recursive)
                                  recurse=t
                                  ;;
                          *)
                                  if test -d "$1"
                                  then
                                          search_path="$1"
                                  else
                                          echo "$1 not a valid path or option"
                                          return 1
                                  fi
                                  ;;
                  esac
                  shift
          done
  
        find $search_path ${recurse:--maxdepth 1} -type l ! -exec test -e {} \; -print
      }
  </code></pre>
  
  <p>Just to be clear, in the <code>find</code> line, I'd like this: if <code>recurse</code> is null, substitute <code>-maxdepth 1</code>. If <code>recurse</code> is set to <code>t</code>, substitute nothing (i.e. let find do it's normal recursive behavior).</p>
  
  <p>It may be kind of weird to look at because, although this is just the <code>${name:-word}</code> form, <code>word</code> actually starts with a hyphen. (See more about this here <a href="http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion" rel="nofollow">http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion</a>)</p>
  
  <p>Instead, what's happening is, if <code>recurse</code> is null, it substitutes <code>"-maxdepth 1"</code> (note the surrounding quotes) and if <code>recurse</code> is set, it's substituting <code>""</code>.</p>
  
  <p>The exact error when not recursing is  <code>find: unknown predicate `-maxdepth 1'</code>. You can try this for yourself by just saying <code>find "-maxdepth 1"</code> for example. When we do want recursion, something odd is happening I can't quite explain, but the error is <code>find `t': No such file or directory</code>.</p>
  
  <p>Does anyone know how to make zsh not place quotes in this parameter expansion? I believe that is my problem here.</p>
  
  <p>Thanks.</p>