I want to get the exit value (returned by $? on a shell; usually 0 or 1 for success or failure) of a external shell command in Vim. Note that I want to get its standard output too. So I can use the output and the also the exit value in a Vim conditional expression. Is this possible?
I want to get the exit value (returned by $? on a shell; usually
Share
There is
v:shell_errorvariable that has exactly the same value as$?in shell scripts. Works at least after:!,:read !, callingsystem().