Ruby input / output

!Mac OS X-10.15.7!ruby-2.7.1p83


print("hello world")

Execution result

$ruby print.rb
hello world

No line breaks There are various other Ruby output methods It is posted in Command Summary


ARGV(argument vector)

puts "hello #{ARGV[0]}"

Coding with

$ ruby hello_name.rb Cyoukou


hello Cyoukou

Is output Get the string entered with puts and attach it after Hello Other input methods are listed in Command Summary

Recommended Posts

Ruby input / output
[ruby] drill output
[ruby] drill output
[ruby] drill output
Ruby standard output
[ruby] drill output
[ruby] drill output
[ruby] drill output
[ruby] drill output
Ruby standard input
From terminal to Ruby (standard input / output)
Ruby calorie calculation output
Output triangle in Ruby
Ruby receives multi-line input
Ruby Learning # 10 Getting User Input
[Ruby] Receive input from console
Ruby standard input and various methods
[Ruby on Rails] CSV output function
String output method memo in Ruby
Ruby learning 4
[Ruby] Array
Ruby basics
Ruby learning 5
Ruby basics
Ruby Review 2
Ruby addition
Refactoring Ruby
Ruby learning 3
2020/10/4 Morning output
Ruby print puts p printf output method
2020/10/4 noon output
Learning output ~ 11/3 ~
Ruby setting 2
Ruby problem ⑦
2020/10/5 Morning output
Ruby learning 2
[Ruby] Block
Refactoring Ruby
ruby calculator
Ruby learning 6
Ruby settings 1
Refactoring Ruby
Learning output
Implement image input / output with Spring MVC
2020/10/3 Noon output
Ruby basics
Ruby memo
Ruby learning 1
Ruby Review 1
2020/10/3 Morning output
[Ruby] Module
Let's write Java file input / output with NIO
Just input and output images with Spring MVC
[Java] How to get and output standard input
[Ruby] Difference between puts and return, output and return value
Ruby on Rails address automatic input implementation method
[ruby] How to receive values from standard input?