Hello_World

Hello World

Setup

Install ruby on your machine

brew install ruby

Create a new file with .rb extension and save the file.

Change your directory in your shell and run

ruby filename.rb

Normal syntax

print("\n Hello World!")

Environment variables

Check for predefined environment variables defined in the shell

You can set variables in the shell CLI by entering

export CUSTOM_VARIABLE="Kautilya Save"

You can retrieve these environment variables by using the follow ing syntax in ruby

print(ENV["CUSTOM_VARIABLE"])