开发者

What do the & and | operators do in a batch file?

开发者 https://www.devze.com 2023-01-03 18:47 出处:网络
I\'m debugging a batch file left behind by an old employee and I\'ve come across the line: @nmake -f makefile /E 2>&1 | tee %LOGFILEPATH%

I'm debugging a batch file left behind by an old employee and I've come across the line:

@nmake -f makefile /E 2>&1 | tee %LOGFILEPATH%  

What does this do?

I know what @nmake -f makefile /E does and I know 开发者_高级运维what tee %LOGFILEPATH% does, but I can't find anything on what the 2>&1 | means.

Thanks


2>&1 redirects standard error to standard out.

| pipes the output from nmake into tee.


2>&1 redirects the standard error stream to standard output.

The pipe | redirects standard output of the first command to the standard input to the second command.

So your command, bunches all output from nmake and redirects it all to tee

0

精彩评论

暂无评论...
验证码 换一张
取 消