#!/usr/bin/env ruby # 1t - hide cursor and last empty line in tail -f output # # Usage: tail -F /var/log/messages.log |1t STDOUT.sync = STDIN.sync = true begin system "tput", "civis" while line = gets puts unless $. == 1 print line.chomp end rescue Interrupt ensure puts system "tput", "cnorm" end