Get command line input through ARGV : ARGV « Development « Ruby






Get command line input through ARGV


n = ARGV.size
argstr = '"' + ARGV*"," + '"'
puts "#{n} arguments..."
puts "They are: #{argstr}"
puts "Note that ARGV[0] = #{ARGV[0]}"

 








Related examples in the same category

1.Ruby places parameters that are appended to the command line into a special array called ARGV.
2.The two filenames are both command line arguments
3.Assign value to ARGV