diff --git a/ex15.rb b/ex15.rb new file mode 100644 index 0000000..5be6005 --- /dev/null +++ b/ex15.rb @@ -0,0 +1,15 @@ +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() diff --git a/ex15_sample.txt b/ex15_sample.txt new file mode 100644 index 0000000..f4a96d5 --- /dev/null +++ b/ex15_sample.txt @@ -0,0 +1,3 @@ +This is stuff I typed into a file. +It is really cool stuff. +Lots and lots of fun to have in here.