首页 > 其他 > 详细

Batch - 重定向符号 >

时间:2019-10-07 15:01:08      阅读:92      评论:0      收藏:0      [点我收藏+]

 总结

Don‘t use a piping operator, which is what ">" Redirection is.

不要使用管道运算符,即“>”。

 

All programs have three streams:

  • Standard Input (the input from the console)
  • Standard Output (general logging/UI output to the console)
  • Standard Error (logging/UI output to the console meant for error messages or other exceptional behavior)

command >nul

^ This says to pipe the standard-output stream to null.

command 2>nul

^ This says to pipe the standard-error stream to null.

command 2>&1

^ This says to pipe the standard-error stream to the same place as the standard-output stream.

 

1>nul 2>nul

uses 1 for Standard Output and 2 for Standard Error.

1>nul 意思是不显示命令运行的正确提示 2>nul 是不显示错误提示

如果放在一起就是, 正确提示&错误提示将都不显示

 

>是重定向符号

nul是空设备的意思

把提示输入到空设备就不显示了 

Batch - 重定向符号 >

原文:https://www.cnblogs.com/frankcui/p/11630307.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!