Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 2003 15:17:33 +0300 (EEST)
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        freebsd-questions@freebsd.org
Subject:   Re: timestamping a text stream
Message-ID:  <20030519121733.035674DE@pm514-9.comsys.ntu-kpi.kiev.ua>
In-Reply-To: <20030519174723.B93323-100000@hewey.af.speednet.com.au.lucky.freebsd.questions>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 19 May 2003 07:52:43 +0000 (UTC) in lucky.freebsd.questions, Andy Farkas wrote:
> 
> Does anybody know of a program similar to script(1) or tee(1) that will
> timestamp each line of input as it happens?
> 
> Ultimately, I want each line of a `make buildworld` timestamped.
> 

Something like this:

#!/bin/sh

cd /usr/src

make buildworld 2>&1 | while read line; do
	echo `date` ${line}
done

ps: Sorry for possible duplicated answers...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030519121733.035674DE>