title: How to open `find` output with vim?
body: <p>I've written a function that will find a function or class definition among Python files. It generates an argument list to be used with vim. It works for the first argument / file, but fails for subsequent files since the trailing " gets added to the file name.</p>
  
  <p><strong>Despite the correct output generated, when passed to vim it does not work. However, it works when the same output is copy and pasted at the command line. The problem is that the closing <code>"</code> gets parsed as part of the file name when it should be the closing end of a command string:</strong></p>
  
  <p><code>vim +cmd1 file1 +"file2_cmd file2_cmd file2" +"file3_cmd file3_cmd file3"</code></p>
  
  <p>I need the function to add a literal double quote (<code>\"</code>) when adding the command, but then parse literal quote when used with vim. The odd thing is the first literal quote gets parsed but not the end literal quote.</p>
  
  <p><code>vim +cmd file1 +" &lt;-- this quote works, but this one doesn't --&gt; "</code></p>
  
  <p>Code:</p>
  
  <pre><code>function vpfd {
      local args=''
  
      find . -name "*.py" \
          | xargs grep -En "(def|class) ${@}[(:]" \
          | uniq \
          | while read line; do
                name=$(echo "${line}" | awk 'BEGIN { FS=":" }; { print $1 }')
                num=$(echo "${line}" | awk 'BEGIN { FS=":" }; { print $2 }')
                if [ ! "${args}" ]; then
                    args="+${num} ${name}"
                else
                    args+=" +\"tabnew +${num} ${name}\""
                fi
            done
  
      if [ "${args}" ]; then
          echo "vim ${args}"
          read p
          vim $(echo ${args})
      fi
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>$ vpfd main
  vim +33 ./bar.py +"tabnew +15 ./foo.py"
  </code></pre>
  
  <p>If I copy and paste the above line it works just fine, however it does not work when the function tries to open vim and pass it <code>${args}</code>.</p>
  
  <p>Within vim:</p>
  
  <ul>
  <li>error message: <code>Vim: not an editor command: 33 ./bar.py +"tabnew +15 ./foo.py"</code></li>
  <li>only empty file visible</li>
  <li>I exit empty file</li>
  <li>vim then opens <code>./bar.py</code> at correct line and on a second tab opens the incorrect file <code>./foo.py"</code> (trailing <code>"</code>)</li>
  </ul>
  
  <p>If I copy and paste the output line then it works correctly:</p>
  
  <pre><code>$ vim +33 ./bar.py +"tabnew +15 ./foo.py"
  </code></pre>