Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 为什么不';从stdin读取Windows Shell(cmd.exe)内置命令?_Batch File_Cmd_Command Prompt_Windows Shell - Fatal编程技术网

Batch file 为什么不';从stdin读取Windows Shell(cmd.exe)内置命令?

Batch file 为什么不';从stdin读取Windows Shell(cmd.exe)内置命令?,batch-file,cmd,command-prompt,windows-shell,Batch File,Cmd,Command Prompt,Windows Shell,为什么Windows Shell(cmd.exe)内置命令不从stdin读取?(似乎是这样) 例如: echo bar | set /p foo= SET/p确实从管道读取输入,但没有任何好处,因为管道的两侧都在新的cmd.exe进程中执行。因此,一旦管道子进程终止,新定义的变量将丢失 有关更多信息,请参阅堆栈溢出问题-SET/p确实从管道读取输入,但它没有任何好处,因为管道的两侧都在新的cmd.exe进程中执行。因此,一旦管道子进程终止,新定义的变量将丢失 有关更多信息,请参阅堆栈溢出问题-

为什么Windows Shell(cmd.exe)内置命令不从stdin读取?(似乎是这样)

例如:

echo bar | set /p foo=

SET/p确实从管道读取输入,但没有任何好处,因为管道的两侧都在新的cmd.exe进程中执行。因此,一旦管道子进程终止,新定义的变量将丢失


有关更多信息,请参阅堆栈溢出问题-

SET/p确实从管道读取输入,但它没有任何好处,因为管道的两侧都在新的cmd.exe进程中执行。因此,一旦管道子进程终止,新定义的变量将丢失


有关更多信息,请参阅堆栈溢出问题-

set/p
本身确实从stdin读取。在那个例子中,它只是获取管道输入。请先看,然后,整个主题…
set/p
本身确实从stdin读取。在那个例子中,它只是获得管道输入。请先看,然后看整个主题。。。