What's the Windows command shell equivalent of Bash's `true` command?

后端 未结 4 751
庸人自扰
庸人自扰 2021-01-04 03:22

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-z

4条回答
  •  天涯浪人
    2021-01-04 03:44

    cd .
    

    also sets %ERRORLEVEL% to 0 but runs a bit faster and writes a bit shorter than ver>nul. Example:

    mkdir . 2>nul || cd .
    

提交回复
热议问题