# Can not puts '\\c' in irb

**URL:** <https://rubytalk.org/t/can-not-puts-c-in-irb/39702>\
**Category:** ruby-talk\
**Created:** [6 August 2007 13:26 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702 "2007-08-06T13:26:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronald\_Fischer1](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@Ronald\_Fischer1](https://rubytalk.org/u/Ronald_Fischer1)\
**Post date:** [6 August 2007 13:26 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702/1 "2007-08-06T13:26:23Z")

</div>

irb 0.9.5 for Windows:

irb(main):016:0\> puts '\c'  
irb(main):017:0'

i.e. irb expects a continuation line. Guess this is a bug?

In case someone has a more recent release of irb, does this still  
occur in the newer one?

Ronald Fischer

> **···**
>
> --  
> Ronald Fischer \<[ronald.fischer@venyon.com](mailto:ronald.fischer@venyon.com)\>  
> Phone: +49-89-452133-162

---

<div class="post-metadata">

**Author:** ![Lloyd\_Linklater](https://avatars.discourse-cdn.com/v4/letter/l/919ad9/32.png) [@Lloyd\_Linklater](https://rubytalk.org/u/Lloyd_Linklater)\
**Post date:** [6 August 2007 13:53 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702/2 "2007-08-06T13:53:29Z")

</div>

Ronald Fischer wrote:

> irb 0.9.5 for Windows:
> 
> irb(main):016:0\> puts '\c'  
> irb(main):017:0'
> 
> i.e. irb expects a continuation line. Guess this is a bug?
> 
> Ronald Fischer

What about

puts "\\c"

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Ari\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Ari\_Brown](https://rubytalk.org/u/Ari_Brown)\
**Post date:** [6 August 2007 14:33 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702/3 "2007-08-06T14:33:10Z")

</div>

You need to use double quotes " " instead of single quotes ' ' because you're dealing with an escape sequence (I assume).

But this is just my random guess at the solution to your problem... so..... keep it ruby 🙂

> **···**
>
> On Aug 6, 2007, at 9:26 AM, Ronald Fischer wrote:
> 
> > irb 0.9.5 for Windows:
> > 
> > irb(main):016:0\> puts '\c'  
> > irb(main):017:0'
> > 
> > i.e. irb expects a continuation line. Guess this is a bug?
> > 
> > In case someone has a more recent release of irb, does this still  
> > occur in the newer one?
> > 
> > Ronald Fischer
> > 
> > --  
> > Ronald Fischer \<ronald.fischer@venyon.com\>  
> > Phone: +49-89-452133-162
> 
> ---------------------------------------------------------------|  
> ~Ari  
> "I don't suffer from insanity. I enjoy every minute of it" --1337est man alive

---

<div class="post-metadata">

**Author:** ![Ronald\_Fischer1](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@Ronald\_Fischer1](https://rubytalk.org/u/Ronald_Fischer1)\
**Post date:** [6 August 2007 14:51 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702/4 "2007-08-06T14:51:01Z")

</div>

> Ronald Fischer wrote:  
> \> irb 0.9.5 for Windows:  
> \>  
> \> irb(main):016:0\> puts '\c'  
> \> irb(main):017:0'  
> \>  
> \> i.e. irb expects a continuation line. Guess this is a bug?  
> \>  
> \> Ronald Fischer
> 
> What about
> 
> puts "\\c"

This works, but that's not the point. The fact is that  
puts '\c' works inside a Ruby program, but does not work  
within irb.

Does anyone know whether this this a known limiation of irb, or a bug?

Ronald

> **···**
>
> --  
> Ronald Fischer \<ronald.fischer@venyon.com\>  
> Phone: +49-89-452133-162

---

<div class="post-metadata">

**Author:** ![Keiju](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@Keiju](https://rubytalk.org/u/Keiju)\
**Post date:** [6 August 2007 15:50 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702/5 "2007-08-06T15:50:11Z")

</div>

> This works, but that's not the point. The fact is that  
> puts '\c' works inside a Ruby program, but does not work  
> within irb.
> 
> Does anyone know whether this this a known limiation of irb, or a  
> bug?

This is a bug of irb. I fix this bug in ruby-trunk(Ruby-1.9).

-- keiju

---

<div class="post-metadata">

**Author:** ![Ronald\_Fischer1](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@Ronald\_Fischer1](https://rubytalk.org/u/Ronald_Fischer1)\
**Post date:** [8 August 2007 14:57 UTC](https://rubytalk.org/t/can-not-puts-c-in-irb/39702/6 "2007-08-08T14:57:22Z")

</div>

> \>This works, but that's not the point. The fact is that  
> \>puts '\c' works inside a Ruby program, but does not work  
> \>within irb.  
> \>  
> \>Does anyone know whether this this a known limiation of irb, or a  
> \>bug?
> 
> This is a bug of irb. I fix this bug in ruby-trunk(Ruby-1.9).

Thank you! I had overlooked your reply and have in the meantime  
already opened a bug report on the Ruby bug tracker (id 12868) ☹

Ronald

> **···**
>
> --  
> Ronald Fischer \<ronald.fischer@venyon.com\>  
> Phone: +49-89-452133-162
