脚本读取的文字档案:
ex15_sample.txt
This is stuff I typed into a file.
It is really cool stuff.
Lots and lots of fun to have in here.
ruby脚本:
filename= ARGV.first # ARGV获取传进来第一个的参数
prompt= "> "#可以理解是一个标志字符串
txt= File.open(filename) #从执行脚本中得到的参数作为文件名字,这是脚本打开文件操作。
puts"Here's your file: #{ filename}"#执行语句