Re: Saving output of an application



On 2006-05-30 21:52, Lars Stokholm <lars.stokholm@xxxxxxxxx> 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 :)

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Saving output of an application
    ... way of saving everything that's going on in the terminal, ... remember the command for doing so. ... # someting something (this would stop logging and close the file) ... file.name would then contain all of the output of portupgrade. ...
    (freebsd-questions)
  • Re: Announcement: bashcritic
    ... All shells but bash will allow any command. ... Not true, works in ksh88, ksh93, Bourne shell, ash, pdksh, posh, ... pedantic here in not supporting simple commands like every other ...
    (comp.unix.shell)
  • test command differences between IRIX and Linux
    ... I've been living fat dumb and happy, using Bourne Shell, and under ... IRIX for the past 10 years or so. ... In several places I have used the test command to test for readable ... How would I test one or more readable files in a directory under Bash, ...
    (comp.unix.shell)
  • Re: test command differences between IRIX and Linux
    ... > I've been living fat dumb and happy, using Bourne Shell, and under ... > In several places I have used the test command to test for readable ... > command, it bombs out with completely unwanted extra help, without ... > How would I test one or more readable files in a directory under Bash, ...
    (comp.unix.shell)
  • Re: How to list the first 10 lines error from executing command
    ... softwares only work in tcsh. ... Anyway, the inconvenience for me to use Bourne Shell is that, I don't know ... the arrows keys can display the ... command histroy,so that long command line can be issued by a Arrow key ...
    (comp.unix.programmer)