From owner-freebsd-questions@FreeBSD.ORG Mon May 19 04:30:21 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB96C37B401 for ; Mon, 19 May 2003 04:30:21 -0700 (PDT) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDCF743F75 for ; Mon, 19 May 2003 04:30:20 -0700 (PDT) (envelope-from barner@in.tum.de) Received: from mailrelay1.informatik.tu-muenchen.de (mailrelay1.informatik.tu-muenchen.de [131.159.254.5]) by mailout.informatik.tu-muenchen.de (Postfix) with ESMTP id 5F0B1632F; Mon, 19 May 2003 13:30:12 +0200 (MEST) Received: from mail.informatik.tu-muenchen.de (mail.informatik.tu-muenchen.de [131.159.0.26]) by mailrelay1.informatik.tu-muenchen.de (Postfix) with ESMTP id 222DC7943; Mon, 19 May 2003 13:30:20 +0200 (MEST) Received: from zi025.glhnet.mhn.de (unknown [129.187.19.157]) by mail.informatik.tu-muenchen.de (Postfix) with ESMTP id 0742A6C; Mon, 19 May 2003 13:30:20 +0200 (MEST) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id 76E8637B4C; Mon, 19 May 2003 13:30:18 +0200 (CEST) Date: Mon, 19 May 2003 13:30:17 +0200 From: Simon Barner To: Andy Farkas Message-ID: <20030519113017.GA46308@zi025.glhnet.mhn.de> References: <20030519174723.B93323-100000@hewey.af.speednet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030519174723.B93323-100000@hewey.af.speednet.com.au> User-Agent: Mutt/1.5.4i cc: freebsd-questions@FreeBSD.ORG Subject: Re: timestamping a text stream X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2003 11:30:22 -0000 Hi, > Does anybody know of a program similar to script(1) or tee(1) that will > timestamp each line of input as it happens? You can use this perl script: #!/usr/bin/perl -w # This is timestamp.pl use strict; my $line=undef; my $stamp; while (defined ($line = <>)) { $stamp = localtime (time ()); print ("$stamp: $line"); } echo "foo" | ./timestamp.pl Mon May 19 13:25:31 2003: foo > Ultimately, I want each line of a `make buildworld` timestamped. So, something like 'make buildworld 2>&1 | ./timestamp.pl' is what you want. Simon