# Input/Output to IRB using Pipes

**URL:** <https://www.ruby-forum.com/t/input-output-to-irb-using-pipes/190263>\
**Category:** Ruby\
**Created:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/input-output-to-irb-using-pipes/190263 "2010-06-17T16:22:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narayanan\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@Narayanan\_K](https://www.ruby-forum.com/u/Narayanan_K)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/input-output-to-irb-using-pipes/190263/1 "2010-06-17T16:22:32Z")

</div>

Hi,

I have a situation where I need to create a pipe into which I load  
ruby/irb  
commands.  
Then I have to direct input from this pipe to IRB (Interactive Ruby) .  
Also I will have an output pipe to which the irb results/output are  
redirected to.

Thus I am changing the STDIN/STDOUT of IRB to Input/Output to/from pipe.

Please suggest ways by which I can do this…

Thanks in advance,

Narayanan

---

<div class="post-metadata">

**Author:** ![Narayanan\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@Narayanan\_K](https://www.ruby-forum.com/u/Narayanan_K)\
**Post date:** [June 17, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/input-output-to-irb-using-pipes/190263/2 "2010-06-17T16:26:59Z")

</div>

On Wed, Jun 16, 2010 at 9:04 PM, Narayanan K [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> I have a situation where I need to create a pipe into which I load ruby/irb  
> commands.  
> Then I have to direct input from this pipe to IRB (Interactive Ruby) .  
> Also I will have an output pipe to which the irb results/output are  
> redirected to.
> 
> Thus I am changing the STDIN/STDOUT of IRB to Input/Output to/from pipe.

Check out my guirb project: [GitHub - martindemello/guirb: Graphical IRB wrappers](http://github.com/martindemello/guirb)

martin

---

<div class="post-metadata">

**Author:** ![Narayanan\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@Narayanan\_K](https://www.ruby-forum.com/u/Narayanan_K)\
**Post date:** [June 17, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/input-output-to-irb-using-pipes/190263/3 "2010-06-17T16:27:03Z")

</div>

From: Martin DeMello [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: Input/Output to IRB using Pipes  
Date: Thu, 17 Jun 2010 01:24:48 +0900  
Message-ID:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > I have a situation where I need to create a pipe into which I load ruby/irb  
> > commands.  
> > Then I have to direct input from this pipe to IRB (Interactive Ruby) .  
> > Also I will have an output pipe to which the irb results/output are  
> > redirected to.
> > 
> > Thus I am changing the STDIN/STDOUT of IRB to Input/Output to/from pipe.
> 
> Check out my guirb project: [GitHub - martindemello/guirb: Graphical IRB wrappers](http://github.com/martindemello/guirb)

Are ‘irbtkw.rbw’ and ‘tktextio.rb’ useful?  
Those exist on “ext/tk/sample” directory of Ruby’s source tree.
