I can't force the end user to choose a particular shell.  

I am thinking about using the open3 module( I just searched in the
archives ) but would still like to munge the output would
something like this work:

write, read, err = open3( "/usr/atria/bin/cleartool"... )

err.reopen( read )

Thanks!

donald
On Thu, Mar 22, 2001 at 12:37:25AM +0900, Henry T. So Jr. wrote:
> In [ruby-talk:13033], Donald Sharp <sharpd / cisco.com> wrote:
> > Or alternatively is there a better way to do this?
> >
> > When I do a:
> >
> > pipe = IO.popen( "/usr/atria/bin/cleartool", "r+" )
> >
> > # There's no such file as blah/blah so cleartool will output
> > # that message on stderr.
> > pipe.puts( "ls blah/blah\n" )
> >
> > # So the error message goes to the screen and the pipe.gets hangs.
> > line = pipe.gets
> >
> > I'd prefer the ability to munge stdout and stderr what is the proper
> > way( so I can interpret the result properly )?
> >
> > Thanks!
> >
> > donald 
> 
> Try ``pipe = IO.popen( "/usr/atria/bin/cleartool 2>&1". "r+" )''
> 
> If you're using a bourne-shell or bourne-shell(-like)-derivative, this will 
> cause the redirect of stderr into stdout (along with stdout).  I'm not sure of 
> how you'd do this in csh or csh-derivatives.
> 
> Henry.
>