$ cat testscript.rb #!/usr/bin/env ruby a_string = "Hello World!" puts a_string puts a_string.class
The first line is slightly unusual because:
Announcement
You can find all my latest posts on medium.https://en.wikibooks.org/wiki/Ruby_Programming/Hello_world#Using_env
Next make it an executable:
$ chmod 777 testscript.rb
then run the script:
$ ./testscript.rb Hello World! String