Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!ptsfa!ihnp4!homxb!houxm!hropus!jgy From: jgy@hropus.UUCP (John Young) Newsgroups: comp.unix.wizards Subject: Re: shell stderr in popen() Message-ID: <1233@hropus.UUCP> Date: Tue, 11-Aug-87 11:12:06 EDT Article-I.D.: hropus.1233 Posted: Tue Aug 11 11:12:06 1987 Date-Received: Thu, 13-Aug-87 03:45:25 EDT References: <4511@sunybcs.UUCP> <8708100615.AA06203@ephemeral.ai.toronto.edu> <7932@mimsy.UUCP> Distribution: na Organization: Bell Labs, Holmdel, NJ Lines: 19 > >In article <7928@mimsy.UUCP> I suggest: > ># (void) sprintf(expandcmd, "sh -c '%s' 2>/dev/null", command); > ># iop = popen(expandcmd, "r"); > > In article <8708100615.AA06203@ephemeral.ai.toronto.edu> rayan@utegc.UUCP > writes: > >Seems too expensive. Try > > > > popen("exec 2> /dev/null ; /usr/bin/mynewcommand -flags", "r"); > > This is a good idea. Unfortunately, it does not work; the shell has > already set its own standard error to another descriptor, so that it > can still print errors. > -- > In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) > Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris > It has always worked for me on System V systems.