You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
283 B
19 lines
283 B
13 years ago
|
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
|