Using a Shebang Line on Unix/Linux : shebang line « Language Basics « Ruby






Using a Shebang Line on Unix/Linux


# A shebang line may appear on the first line of a Ruby program (or other program or script). 
# It helps a Unix/Linux system execute the commands according to a specified interpreterRuby. 
# This does not work on Windows.


#!/usr/bin/env ruby   

puts "Hello, Tom!"

 








Related examples in the same category

1.avoid typing ruby each time on Unix/Linux systems by adding a shebang line (#!) at the top of your Ruby file.