我需要用最多 2 个表达式将 CMD 中的键盘输入 + 文本 + 错误文本重定向到 nul。
类似的东西*command* >nul 2>&1。
另一种方法是>nul 1>nul 2>nul,但正如我所说,我想尽可能减少命令。
谢谢。
我不知道将所有 3 个 ( stdin, stdout& stderr) 重定向到nul任何少于 3 个命令的方法。
所以,如果这是可以接受的 - 类似于 Windows 批处理文件的隐藏功能- command <nul >nul 2>&1,它会重定向stdout到 nul,并重定向到stderr与stdout
0 = stdin
1 [默认省略,如示例] = stdout
2 =stderr