Date: Wed, 31 May 2006 02:02:58 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Lars Stokholm <lars.stokholm@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Saving output of an application Message-ID: <20060530230258.GA17334@gothmog.pc> In-Reply-To: <a5eea06e0605301252p563b8d33nde70dd18f299fa66@mail.gmail.com> References: <a5eea06e0605301252p563b8d33nde70dd18f299fa66@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-05-30 21:52, Lars Stokholm <lars.stokholm@gmail.com> 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 :)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060530230258.GA17334>
