From owner-freebsd-questions@FreeBSD.ORG Tue May 30 23:01:22 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 33BAC16B50E for ; Tue, 30 May 2006 23:01:22 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D2BA43D70 for ; Tue, 30 May 2006 23:01:13 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.6/8.13.6/Debian-1) with ESMTP id k4UN0kxN020351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 31 May 2006 02:00:48 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.6/8.13.6) with ESMTP id k4UN2xtg017385; Wed, 31 May 2006 02:02:59 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.6/8.13.6/Submit) id k4UN2wA5017384; Wed, 31 May 2006 02:02:58 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 31 May 2006 02:02:58 +0300 From: Giorgos Keramidas To: Lars Stokholm Message-ID: <20060530230258.GA17334@gothmog.pc> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.406, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.79, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: Saving output of an application X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2006 23:01:36 -0000 On 2006-05-30 21:52, Lars Stokholm wrote: > I don't know how to explain this, but I remember that there is some > way of saving everything that's going on in the terminal, I just don't > remember the command for doing so. I think it's something along the > lines of (e.g.): > > # something file.name (this would start logging) > # portupgrade -a (or anything else) > # someting something (this would stop logging and close the file) > > file.name would then contain all of the output of portupgrade. Can > someone help me with the right command? :) The script(1) utility is the one you are looking for. If you are using bash or a Bourne shell, you can also use: $ cmd 2>&1 | tee logfile or when multiple commands are involved, parentheses: $ ( cmd ; cmd2 ) 2>&1 | tee logfile I use the Bourne shell redirection trick to save the output of builds, for instance: csh# sh $ cd /usr/src $ ( make KERNCONF=FOO buildworld buildkernel ) 2>&1 | tee logfile It comes very handy whenever I need to go back and see the log of the build :)