Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: shell stderr in popen() Message-ID: <7932@mimsy.UUCP> Date: Mon, 10-Aug-87 11:36:17 EDT Article-I.D.: mimsy.7932 Posted: Mon Aug 10 11:36:17 1987 Date-Received: Tue, 11-Aug-87 06:08:34 EDT References: <4511@sunybcs.UUCP> <8708100615.AA06203@ephemeral.ai.toronto.edu> Distribution: na Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 >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