Using a vim function, I would like to check if a program is running using pgrep, and if it is not running then do something. In particular, I want to achieve something like this:
function! checkifrunning(mystring) if 'pgrep "mystring"' shows that something is NOT running --do something-- endif endfunction
My guess is that I need to use the 'system()' function, but I'm not sure how. Can somebody help?
EDIT: I would like a solution that uses pgrep in particular, and not some other way