From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 30 Mar 1995 02:07:30 -0500 From: Amos Shapir amos@CS.HUJI.AC.IL Subject: An rc challenge Topicbox-Message-UUID: 092e175e-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19950330070730.Mpb17sBOF8EUbr7XTEfE74jSczGrrBNJjSAVoC4LGTg@z> Here's a (very weird) reply to the problem of doing named pipes in rc: mount /fd/1 /mnt | @{out_cmd |[9=1] exportfs -s}& in_cmd /mnt/fd/9 unmount /mnt The principle is that each of the commands on the first lines has a different view in its namespace, of which fd goes where; I'll try to explain as best as I can (which may be a bit wrong, since I didn't invent it): The "mount" command binds its /fd/1 on /mnt (which may be any available directory); the first pipe connects it to fd/0 of the commands within the {}. The second pipe connects the stdout of "out_cmd" as its /fd/9, to the input side of /fd/1 of "exportfs". The result is that anything written by "out_cmd" can be read on /fd/9 of "exportfs", which exports its namespace to the outside world. There, the internal /fd directory is bound to /mnt; this enables "in_cmd" to read "out_cmd"'s output from /mnt/fd/9. Phew! There must be a better way to make pizza! -- Amos Shapir Net: amos@cs.huji.ac.il Paper: The Hebrew Univ. of Jerusalem, Dept. of Comp. Science. Givat-Ram, Jerusalem 91904, Israel Tel: +972 2 585706,586950 GEO: 35 11 46 E / 31 46 21 N