News for hackers. Stuff that matters.
Re:How Ruby is beating Python in the battle for the Soul of ... by davnola on Monday October 03, 2011 @09:35AM (#3066196)
Cool. That hurts my eyes.

    ruby -e "print ARGF.readlines.last(10)"
Re:How Ruby is beating Python in the battle for the Soul of ... by rytis on Monday October 03, 2011 @10:21AM (#3066355)
on, say, a 5GB log file?..

If I read this correctly (http://www.ruby-doc.org/core/classes/IO.html#M000914) it'll read the whole file into an array, then spit out last 10 entries?

Re:How Ruby is beating Python in the battle for the Soul of ... by davnola on Monday October 03, 2011 @12:09PM (#3066809)
Yes it does - good point, but the sigil-tastic snippet in the parent reads the whole file into an array, too - it's just harder to tell.

Plus the parent snippet is not Ruby 1.9 compatible.

Anyways, my version was just to illustrate that sysadmin scripting in Ruby does not have illegible.