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*

12
  • yes I agree, named pipes are probably the most overrated thing I can think of - I always have problems when I try to use them. with unix domain sockets, I would need multiple servers listening from the same socket - which isn't possible. But multiple "servers" can cat the same fifo, so that works out better. Commented Jun 5, 2019 at 0:20
  • can you explain how this works a little bit more? Why file descriptor 1? Commented Jun 5, 2019 at 0:22
  • 1
    Because the <> redirection will use the stdin (0) by default (except in ksh93, as explained in the linked answer from Stéphane Chazelas). Commented Jun 5, 2019 at 0:24
  • Right but why does it have to be 1 instead of 0? (stdout instead of stdin) Commented Jun 5, 2019 at 0:26
  • 1
    Instead of exploiting the fact that dup2 is closing the oldfd, you can use another fd and close it explicitly with the same effect: /bin/echo 7<>fifo >fifo 7>&-. Commented Jun 5, 2019 at 0:40