From: William James Date: 2007-04-27T16:20:06+09:00 Subject: Re: Output A File w/ Line Numbers? On Apr 27, 1:39 am, John Joyce wrote: > I'd like to read a file and output its contents (just to terminal is > fine for simplicity) with line numbers. > Is there a Ruby library method that handles this like unix cat? > Of course we can write a looping one-liner, but it seems to me this > function must already exist. > > love, > John Joyce ruby -ne 'BEGIN{$n=0}; print "#{$n+=1} "; print' junk