Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!cbosgd!cwruecmp!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: shell stderr in popen() Message-ID: <4126@ncoast.UUCP> Date: Wed, 12-Aug-87 20:29:26 EDT Article-I.D.: ncoast.4126 Posted: Wed Aug 12 20:29:26 1987 Date-Received: Sat, 15-Aug-87 08:25:17 EDT References: <124@foobar.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Distribution: na Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 21 As quoted from <124@foobar.UUCP> by tw@foobar.UUCP (Tom Walsh): +--------------- | | hi, sortof like the scanf() contest... | i have a need to use popen(command, "r"). if command is not | found, i would like to dispose quietly of the shell's complaint: | sh: command: not found | the stderr of the command itself can be handled ala: | popen("/usr/bin/mynewcommand -flags 2> /dev/null", "r"); | but if "mynewcommand" isn't around, the shell's stderr still | gets put on the *real* stderr. +--------------- popen("exec 2> /dev/null; /usr/bin/mynewcommand -flags", "r"); -- Brandon S. Allbery, moderator of comp.sources.misc and comp.binaries.ibm.pc {{harvard,mit-eddie}!necntc,well!hoptoad,sun!mandrill!hal}!ncoast!allbery ARPA: necntc!ncoast!allbery@harvard.harvard.edu Fido: 157/502 MCI: BALLBERY <> ** Site "cwruecmp" is changing its name to "mandrill". Please re-address ** *** all mail to ncoast to pass through "mandrill" instead of "cwruecmp". ***