yburge:

In addition to the answers you've already received, if you're on a *nix box you can also use the script or tee commands.

The script command is used to capture an entire command shell session, something1 like:

devo$ script junk.log devo$ ls foo bar baz devo$ exit
The first script command opens a new shell where all I/O is written to junk.log in addition to the console. The exit ends the shell, and the contents of junk.log should1 be:

devo$ ls foo bar baz devo$ exit
The tee command simply copies everything going to STDOUT to the specified file, like this:

devo$ ls | tee junk.log
Here, the contents of tee would be "foo bar baz\n". Note that the STDERR would still go to wherever it normally goes. You can capture STDERR also if you do something1 like this:

devo$ (ls 2>&1) | tee junk.log
Hope this helps....

1Note: I didn't actually run this on the console of a *nix box, as my Linux box is currently down. So I faked the examples, and may have mucked it up somewhat.

--roboticus


In reply to Re: execution log by roboticus
in thread execution log by yburge

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.