On Sun, Jun 7, 2009 at 10:09 PM, Tim Chase wrote:
>
>> fun Pgrep(pattern, file)
>>     grep a:pattern a:file
>>
>>
>> * a:file -- no such file or directory.
>>
>> Exactly why is echo substituting arguments when
>> grep is not?
>
> The grep expects a filename, not a variable as the 2nd argument.  Try
>
>   exec 'grep a:pattern '.a:file

Doesn't that need to be

  exec 'grep ' . a:pattern . ' ' . a:file

or some such?  Probably with some shellescape()'s in there, as well...

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to