Sha256: adf3b44b8fee65a024016cc7fd74474d218be060e15fbcaef3025527a7280db2
Contents?: true
Size: 419 Bytes
Versions: 13
Compression:
Stored size: 419 Bytes
Contents
#!/usr/bin/env ruby # A poor man's pager... :) require 'file/tail' filename = ARGV.shift or fail "Usage: #$0 filename [height]" height = (ARGV.shift || ENV['LINES'] || 23).to_i - 1 File::Tail::Logfile.open(filename, :break_if_eof => true) do |log| begin log.tail(height) { |line| puts line } print "Press return key to continue!" ; gets print "" redo rescue File::Tail::BreakException end end
Version data entries
13 entries across 13 versions & 1 rubygems