On 30/01/09 07:52, WiggyWare wrote:
> How would I save the results of an os call/script to a variable? I
> would like to execute an os command in vimrc and assign the result to
> a variable for use later in vimrc
>
> I've tried
> let s:myvar = execute '! some os command'
> but I get:
> E121: Undefined variable: execute
> E15: Invalid expression: execute '! ps -f | grep string_with_no_match'
>
> Thanks very much in advance!

(untested)

        let s:myvar = system('ps -f | grep string_with_no_match')

see
        :help system()


Best regards,
Tony.
-- 
Pro is to con as progress is to Congress.

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

Reply via email to