相关疑难解决方法(0)

通过把手向下管道

说我有

node foo.js | node bar.js
Run Code Online (Sandbox Code Playgroud)

有没有办法将foo的stdin句柄传递给bar.js?

我有一个罕见的案例,我想在管道中向后沟通.

至少我知道我可以发送node bar.jspid node foo.js.鉴于pid,在*nix上,我应该能够使用以下命令写入foo的stdin:

/proc/<pid>/fd/0
Run Code Online (Sandbox Code Playgroud)

但有没有办法在MacOS上做同样的事情?

macos stdin pid file-descriptor node.js

4
推荐指数
1
解决办法
139
查看次数

标签 统计

file-descriptor ×1

macos ×1

node.js ×1

pid ×1

stdin ×1