Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!utegc!rayan From: rayan@utegc.UUCP Newsgroups: comp.unix.wizards Subject: Re: shell stderr in popen() Message-ID: <8708100615.AA06203@ephemeral.ai.toronto.edu> Date: Mon, 10-Aug-87 02:15:53 EDT Article-I.D.: ephemera.8708100615.AA06203 Posted: Mon Aug 10 02:15:53 1987 Date-Received: Mon, 10-Aug-87 04:54:15 EDT References: <4511@sunybcs.UUCP> Distribution: na Organization: University of Toronto, AI group Lines: 25 Checksum: 33829 In article <7928@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: # >In article <124@foobar.UUCP> tw@foobar.UUCP (Tom Walsh) writes: # >> ... i would like to dispose quietly of the shell's complaint: # >> sh: command: not found # # In article <4511@sunybcs.UUCP> ugbinns@sunybcs.uucp (Leonard Binns) writes: # > popen("/usr/bin/mynewcommand -flags 2>& /dev/null", "r"); # # This will not do it. ... [try:] # # (void) sprintf(expandcmd, "sh -c '%s' 2>/dev/null", command); # iop = popen(expandcmd, "r"); Seems too expensive. Try popen("exec 2> /dev/null ; /usr/bin/mynewcommand -flags", "r"); exec with no command does wonderful things to your shell. It is documented too, on BSD flavours at least. Also, it is built-in (obviously) so there is very little overhead involved. rayan -- Rayan Zachariassen AI group, University of Toronto