diff --git a/ex15-ec.rb b/ex15-ec.rb new file mode 100644 index 0000000..a111ec9 --- /dev/null +++ b/ex15-ec.rb @@ -0,0 +1,18 @@ +filename = ARGV.first + +prompt = "> " +txt = File.new(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.new(file_again) + +puts txt_again.read + +txt.close +txt_again.close