Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

14
  • File descriptors are local to a process, or there would be issues with file descriptors 1 and 2. Commented May 3, 2020 at 8:05
  • So that means in my node process I can rely on writing to /dev/fd/3 since my node process gets access to that very one ? How would I then know if the file descriptors are REALLY at /dev/fd/3 ? Is it different depending on the OS? Commented May 3, 2020 at 8:07
  • It looks like this is guaranteed by the shell script. Commented May 3, 2020 at 8:17
  • Reading your text, I can't see why you don't just use res=$(node test.js) Commented May 3, 2020 at 22:21
  • Because that locks stdout etc. in the subshell and therefore hides it away. The test.js however is interactive. Commented May 4, 2020 at 6:20