Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!lzga!bogatko From: bogatko@lzga.ATT.COM (George Bogatko) Newsgroups: comp.unix.questions Subject: Re: redirecting standard i/o from an exec'ed programme Summary: crow eating example. Keywords: popen, io, exec, system Message-ID: <2019@lzga.ATT.COM> Date: 23 Aug 90 12:40:22 GMT References: <377@fe2o3.UUCP> <2007@lzga.ATT.COM> <3939@auspex.auspex.com> Organization: AT&T BL Middletown/Lincroft NJ USA Lines: 16 In article <3939@auspex.auspex.com>, guy@auspex.auspex.com (Guy Harris) writes: > >Popen is expensive. It requires a shell for 'system' and then > >another shell to run your request in. > > It doesn't use "system()" on any UNIX implementation I've used (V7, BSD, > S3, S5, etc.). It just runs *one* shell, which runs your command. Absolutly right. I goofed. What we saw was an explosion of 'exec' calls when people used popen instead of directly calling 'fork' and 'exec'. One exec for the shell, and another exec for the program, if it didn't involve a pipeline. Sorry, GB