Is there a way to redirect ONLY stderr to stdout (not combine the two) so it can be piped to other programs?

前端 未结 2 2056
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 16:18

I\'m working in a Windows CMD.EXE environment and would like to change the output of stdout to match that of stderr so that I can pipe

2条回答
  •  春和景丽
    2020-11-27 16:34

    From looking at http://support.microsoft.com/kb/110930 it seems that you want 2>&1 1>NUL. So something like the following should work for you:

    test.exe 2>&1 1>NUL | find "someErrorString"
    

提交回复
热议问题