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.

Required fields*

3
  • echo -e "World\nEverybody" 3<&- | php script.php and passthru("nano <&3 3<&-"); gives sh: 3: Bad file descriptor. Maybe I'm getting you wrong. Could you provide a changed version of my script and command line that works? Commented Mar 19, 2018 at 15:22
  • @forthrin, you need to open that fd 3 to something (the original stdin) first with the { ...; } 3<&0. See edit. Commented Mar 19, 2018 at 15:38
  • nano < /dev/tty works perfectly! I'll try to read up on the low level stuff on pipes. Perfect excuse to dig deeper into the magic realms of UNIX. Great explanation! Commented Mar 19, 2018 at 15:52