Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9297251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:01:27+00:00 2026-06-18T22:01:27+00:00

From the doc -0digit => specifies the input record separator ($/) as an octal

  • 0

From the doc

-0digit =>

specifies the input record separator ($/) as an octal number. If no digits given, the null character is the separator. Other switches may follow the digits. -00 turns Ruby into paragraph mode. -0777 makes Ruby read whole file at once as a single string, since there is no legal character with that value.

My bad! Couldn’t digest it at all. So let’s started to play with it.

C:\>ruby -0777 -e 'a= gets; puts a '
Hi, This is Ram.
Could you help me here?
^Z #~~~> pressed ENTER here after CTRL+Z and got the output as below-
Hi, This is Ram.
Could you help me here?
C:\>ruby #~~~> return the prompt

C:\>ruby -000 -e 'a= gets; puts a '
Hi, This is Ram.
Could you help me here?
^Z #~~~> pressed ENTER here after CTRL+Z and got the output as below-
Hi, This is Ram.
Could you help me here?
C:\>ruby #~~~> return the prompt

C:\>ruby -00 -e 'a= gets; puts a '
Hi, This is Ram.
Could you help me here? #~~~> pressed ENTER
#~~~> pressed ENTER here and got the output as below-
Hi, This is Ram.
Could you help me here?
C:\>ruby #~~~> return the prompt

Question: 1 – Can I set such octal or $/ to as below ?

carraige return (\r)
tab (\t)

If so, Can I have one example for each to see their behaviours?

Question: 2 – I also tried to print the value of "$/" and nothing printed. So how should I see that?

C:\>ruby -00 -e 'a= gets; puts a ;puts "here is: #{$/}"'
hi

hi

here is:


C:\>ruby -0777 -e 'a= gets; puts a ;puts "here is: #{$/}"'
Hey! Arjun
Are you going school?

^Z
Hey! Arjun
Are you going school?

here is:

C:\>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:01:28+00:00Added an answer on June 18, 2026 at 10:01 pm

    From the Using as

    Finally I found out the way about how to set the carraige return (\r) and tab (\t).

    Find the below code:

    C:\>ruby -00 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Hi
    
    Hi
    
    here is: "\n\n"
    
    C:\>ruby -015 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    hi
    hi
    ^Z
    hi
    hi
    here is: "\r"
    
    C:\>ruby -011 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Hello
    
    ^Z
    Hello
    
    here is: "\t"
    
    C:\>
    

    Finally I could print with .inspect as below :

    C:\>ruby -00 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Hi
    
    Hi
    
    here is: "\n\n"
    
    C:\>
    

    Want to share my whole day’s with ruby : 🙂

    From the above link : ASCII Code

    I got the octal code of many more escape characters and also played with them with Ruby command line -0<digit> option:

    Here is the full list of example.. read and digest it. 🙂

    @ubuntu:~$ ruby -010 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    This is a spoon. Do you need it.^H
    This is a spoon. Do you need it.
    here is: "\b"
    
    @ubuntu:~$ ruby -033 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Hi..How are you?
    Are you going ^[ school today?
    Hi..How are you?
    Are you going 
    here is: "\e"
    
    @ubuntu:~$ ruby -011 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Today is very hot outside   the room
    Today is very hot outside   
    here is: "\t"
    
    @ubuntu:~$ ruby -015 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Are you mad?hey..^Mhello..I am telling you dude...
    Are you mad?hey..
    here is: "\r"
    
    @ubuntu:~$ ruby -012 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Are you there?
    Are you there?
    here is: "\n"
    
    @ubuntu:~$ ruby -040 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Iammmmmmmmmm a
    Iammmmmmmmmm 
    here is: " "
    
    @ubuntu:~$ ruby -014 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Earth is an planet.Remember it...^L dear brother
    Earth is an planet.Remember it...
    
    here is: "\f"
    
    @ubuntu:~$ ruby -000 -e 'a= gets; puts a ;puts "here is: #{$/.inspect}"'
    Hiiiii............
    
    Hiiiii............
    
    here is: "\n\n"
    @ubuntu:~$ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this link statement: List<UserGroup> domains = UserRepository.Instance.UserIsAdminOf(currentUser.User_ID); query = (from doc in
From MSDN doc : A delegate is a type that safely encapsulates a method,
From apple doc subview(near to the screen) gets to handle a touch event first
i don't understand this example from the doc : the timeIntervalSinceNow method should show
I'm trying to get the hello world app running from the doc . I
var cityList = from country in doc.Element(result) .Element(cities) .Descendants(city) select new { Name =
I have learned from the sencha doc how to create a simple MVC application,
Please consider the following example code (from the lm doc): ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt
I am trying to copy all format file (.txt,.pdf,.doc ...) file from source folder
From the play2's doc: http://www.playframework.org/documentation/2.0/ScalaForms , there is a sample code: val loginForm =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.