File system name space (/dev/fd)

Kristoffer Eriksson ske at pkmab.se
Tue Oct 30 20:01:59 AEST 1990


Submitted-by: ske at pkmab.se (Kristoffer Eriksson)

In article <14102 at cs.utexas.edu> addw at phcomp.co.uk (Alain Williams) writes:

>> 	join <(prog1) <(prog2) > joined-output-of-progs-1-and-2

>Anyway, the above wouldn't work with a straight /dev/fd as has been talked about
>here recently. Why ? The trouble is that if /dev/fd contains files with
>names "0", "1", ... "19", the programs prog1 & prog2 would both have a file
>/dev/fd/1 as their stdout, join would see another /dev/fd/1.

That's not how you do it. Prog1 and prog2 just output to their standard
outputs, as they always do, and the shell sets up pipes from prog1 and prog2
to join. The /dev/fd names for these pipes, as seen by join, are then passed
as argv[] parameters to join, to make it read them. Prog1 and prog2 never
see them.
-- 
Kristoffer Eriksson, Peridot Konsult AB, Hagagatan 6, S-703 40 Oerebro, Sweden
Phone: +46 19-13 03 60  !  e-mail: ske at pkmab.se
Fax:   +46 19-11 51 03  !  or ...!{uunet,mcsun}!sunic.sunet.se!kullmar!pkmab!ske

Volume-Number: Volume 22, Number 12



More information about the Comp.std.unix mailing list