Mega Code Archive

 
Categories / Ruby / Development
 

Ruby places parameters that are appended to the command line into a special array called ARGV

puts ARGV.join('-') # From the command prompt, run the script like so: ruby argv.rb # The result will be blank, but then try to run it like so: ruby argv.rb test 123