Ilmari Heikkinen
1/1/2006 4:22:00 AM
On 12/31/05, vnpenguin@gmail.com <vnpenguin@gmail.com> wrote:> Hi,> I'm trying to write a small ruby script which accepts:> 1. Input : File or $stdin> 2. Output : File or $stdoutin_file, out_file = ARGVinput = in_file ? File.open(in_file) : $stdinoutput = out_file ? File.open(out_file,'w') : $stdoutinput.each_line{|line| output.print do_some_thing(line)}input.closeoutput.close_writeoutput.close if output.is_a? FileCheers,Ilmari