Pipe input file redirection.

Gary S. Moss VLD/VMB <moss> moss at brl.mil
Tue Oct 2 00:29:41 AEST 1990


In article <3502 at dftsrv.gsfc.nasa.gov>, merritt at iris613.gsfc.nasa.gov (John H Merritt) writes:
|> In article <9009262123.AA24525 at mcirps2.med.nyu.edu> karron%CMCL2.NYU.EDU at cunyvm.cuny.edu writes:
|> >How do I pipe the stdout and stderr files from a collection of programs
|> >into the stdin of another program ?
|> 
|> Assume no_file1 and no_file2 don't exist; 'cat' writes to 2.
|> 
|> With sh:
|> (cat no_file1; cat no_file2) 2>&1 | 1<&2 od -xc

Well, I'm, not sure why, but this results in the output from "od" being on
stderr; when reading TFM about the "1<&2" construct it sheds no light on
reality.

Anyway, the following is sufficient to dup stderr from the subshell to its
stdout for the Bourne shell:

(cat no_file1; cat no_file2) 2>&1 | od -xc



More information about the Comp.sys.sgi mailing list