The two filenames are both command line arguments : ARGV « Development « Ruby






The two filenames are both command line arguments


#!/usr/bin/env ruby
from_filename = ARGV[0]
destination_filename = ARGV[1]

 








Related examples in the same category

1.Ruby places parameters that are appended to the command line into a special array called ARGV.
2.Assign value to ARGV
3.Get command line input through ARGV