I have written a Vim plugin which shells out to run external commands. Two of the commands I run are diff
and grep
which can each exit with a non-zero exit code during "normal" operation.
(diff
exits with exit code 1 when it finds differences and grep
exits with exit code 1 when it doesn't find matches.)
For the purposes of my Vimscript I need to return an exit code of 0 from these commands. So far I'm constructing the commands like this:
diff a b || true
And:
grep foo bar || true
This works for me on OS X and it apparently works for some Windows users. However, when I run Windows 7 on OS X via VirtualBox, using the Bash installed by the Git installer, I get the error message:
'true' is not recognized as an internal or external command, operable program or batch file.
What is the correct successful-no-op command to use on Windows?