Here is a quick and concise way to do this.
# Open first file, read it, store it, then close it input = File.open(ARGV[0]) {|f| f.read() }
An example to run this would be.
$ ruby this_script.rb from_file.txt to_file.txt
This_script.rb is executed and takes two arguments through the command line. The first in our case is from_file.txt (the text is copied), and the second argument is second_file.txt (the text is copied to).
Mur quirk
source share