Path: utzoo!attcan!uunet!cs.utexas.edu!usc!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!carroll From: carroll@m.cs.uiuc.edu Newsgroups: comp.unix.questions Subject: Re: Piping stderr in Korn and/or Bourne Message-ID: <9000029@m.cs.uiuc.edu> Date: 7 Apr 90 16:39:20 GMT References: <3620@hcx1.SSD.CSD.HARRIS.COM> Lines: 29 Nf-ID: #R:hcx1.SSD.CSD.HARRIS.COM:3620:m.cs.uiuc.edu:9000029:000:1235 Nf-From: m.cs.uiuc.edu!carroll Apr 6 13:46:00 1990 /* Written 1:28 pm Apr 5, 1990 by brad@SSD.CSD.HARRIS.COM in m.cs.uiuc.edu:comp.unix.questions */ /* ---------- "Piping stderr in Korn and/or Bourne" ---------- */ >I bow to any of you knowledgeable souls out there >that can assist me with this problem ... > >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 >been looking at pages 136-140 in Korn's book). > [ ... ] >I was hoping one of these last two might give me the output: > > this is stdout > this is STDerr > >I would really like to be able to redirect only stderr to my program >and to leave stdout untouched! (all in a single command). Can this be >done in ksh? (sh? csh?) /* End of text from m.cs.uiuc.edu:comp.unix.questions */ Here are two solutions I came up with: tst 2>&1 >/dev/tty | sed ... tst 3>&2 2>&1 >&3 | sed ... Alan M. Carroll Barbara/Marilyn in '92 : carroll@cs.uiuc.edu + This time, why not choose the better halves? Epoch Development Team + A Bush/Quayle ticket you can feel good about CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll