#!/usr/bin/env ruby # tlog [FMT] - prefix lines with current timestamp fmt = ARGV[0] || "%Y-%m-%d %H:%M:%S " STDIN.sync = true while line = STDIN.gets puts Time.now.strftime(fmt) + line end