home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / std_unix / v22 / 012 / text0000.txt < prev   
Encoding:
Text File  |  1991-03-07  |  1.0 KB  |  24 lines

  1. Submitted-by: ske@pkmab.se (Kristoffer Eriksson)
  2.  
  3. In article <14102@cs.utexas.edu> addw@phcomp.co.uk (Alain Williams) writes:
  4.  
  5. >>     join <(prog1) <(prog2) > joined-output-of-progs-1-and-2
  6.  
  7. >Anyway, the above wouldn't work with a straight /dev/fd as has been talked about
  8. >here recently. Why ? The trouble is that if /dev/fd contains files with
  9. >names "0", "1", ... "19", the programs prog1 & prog2 would both have a file
  10. >/dev/fd/1 as their stdout, join would see another /dev/fd/1.
  11.  
  12. That's not how you do it. Prog1 and prog2 just output to their standard
  13. outputs, as they always do, and the shell sets up pipes from prog1 and prog2
  14. to join. The /dev/fd names for these pipes, as seen by join, are then passed
  15. as argv[] parameters to join, to make it read them. Prog1 and prog2 never
  16. see them.
  17. -- 
  18. Kristoffer Eriksson, Peridot Konsult AB, Hagagatan 6, S-703 40 Oerebro, Sweden
  19. Phone: +46 19-13 03 60  !  e-mail: ske@pkmab.se
  20. Fax:   +46 19-11 51 03  !  or ...!{uunet,mcsun}!sunic.sunet.se!kullmar!pkmab!ske
  21.  
  22. Volume-Number: Volume 22, Number 12
  23.  
  24.