How to pass argument to a script in vim system() call?

system, vim

Solution

Try using `exec`:

exec 'call system("~/script " . expand("%"))'

Depending on what you want to do you might not need `exec` at all (like `:h system()` suggests):

let foo = system("~/script " . expand("%"))

Problem

I would like to pass current filename `%` as argument of the shell script in `system()` call : ``` let rev=system("~/script %") ``` How can I do that for real ?

Original source