Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!samsung!uunet!mcsun!hp4nl!kunivv1!atcmpe!leo From: leo@atcmp.nl (Leo Willems) Newsgroups: comp.unix.questions Subject: Re: Piping stderr in Korn and/or Bourne shell Message-ID: <585@atcmpe.atcmp.nl> Date: 7 Apr 90 19:22:35 GMT References: <3620@hcx1.SSD.CSD.HARRIS.COM> Organization: AT Computing, Nijmegen, The Netherlands Lines: 32 From article <3620@hcx1.SSD.CSD.HARRIS.COM>, by brad@SSD.CSD.HARRIS.COM (Brad Appleton): > > I have a program that is supposed to read error output from other > programs. I want to pipe stderr to this program WITHOUT piping > stdin as well. I have not been able to find this in TFM (I have ...... > I was hoping one of these last two might give me the output: > > this is stdout > this is STDerr > > without piping stdin at all (just stderr) Try this: prog 3>&2 2>&1 1>&3 3>&- | sed 's/std/STD/' This will swap stdout/stderr. If you know a little C under UNIX it says: prog close_3_dup_2 close_2_dup_1 close_1_dup_3 close_3 | sed Hope this helps. Leo Willems Internet: leo@atcmp.nl AT Computing UUCP: mcvax!hp4nl!kunivv1!atcmpe!leo P. O. Box 1428 6501 BK Nijmegen Phone: +31-80-566880 The Netherlands Fax: +31-80-555887