如下所示,父进程生成子进程并设置env变量。此变量用于确定进程在执行文件时是父进程还是子进程。spawn(process.execPath,[__filename], { env: {IS_CHILD : true} sp.stdout.pipe(process.stdout); // if this is commen
(不确定是否有许多或仅仅一对可以包含大量变化的夫妇)
cmd > file1 # stdout of cmd goes to filecmd file1 > file2 # stdout of cmd with file1 as an argument goes to file2
cmd file2 < file1 # stdin