box-o-sand/ex15.rb

16 lines
264 B
Ruby
Raw Normal View History

2012-02-26 04:45:19 +00:00
filename = ARGV.first
prompt = "> "
txt = File.open(filename)
puts "Here's your file: #{filename}"
puts txt.read()
puts "I'll also ask you to type it again:"
print prompt
file_again = STDIN.gets.chomp()
txt_again = File.open(file_again)
puts txt_again.read()