by nabb · 15y ago · 0 comments
ruby -e'$><<$<.map.last(10)'
For the rest of the ruby one-liners in the page the author references, most can be done more easily with standard command line tools (although most people aren't well-versed in sed, so 'ruby -pe puts' might be better than 'sed G'). ruby -e "print ARGF.readlines.last(10)"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?
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.