[sf-lug] terminal program screen capture tool

Marilyn Davis marilyn at deliberate.com
Thu Mar 30 21:11:41 PST 2006


On Thu, 30 Mar 2006, Rick Smith wrote:

> Bill Kendrick wrote:
>  > On Thu, Mar 30, 2006 at 04:44:46PM -0800, Alex Kleider wrote:
>  >> can anyone suggest a simple screen capture  tool? (and how to  install
>  >> and use it)
>  >> all I want to do is capture the results of execution of simple C++
>  >> programs
>  >> from/to the terminal program.
>  >
>  > Err... wouldn't simple Un*x redirection be useful here?
>  >
>  > e.g.:
>  >
>  >   someprogram > outfile.txt
>  >
>  > or:
>  >
>  >   someprogram | tee outfile.txt
> 
> I was thinking along the same lines, additionally getting stderr in
> there too:

Two other possibilities are the script command, and an emacs shell buffer.

The script command:

bash-2.05a$ script
Script started, file is typescript       ( from now on, everything that comes to my screen
bash-2.05a$ ls *.py                      ( also lands in the typescript file
ls: *.py: No such file or directory      ( so here I'm just doing some random stuff
bash-2.05a$ date                         ( to put some stuff in the typescript file
Thu Mar 30 21:05:59 PST 2006
bash-2.05a$ exit                         ( This exit gets me out of the script command
Script done, file is typescript
bash-2.05a$ cat typescript               ( Now, here is what was recorded
Script started on Thu Mar 30 21:05:35 2006
bash-2.05a$ ls: *.py: No such file or directory
bash-2.05a$ Thu Mar 30 21:05:59 PST 2006
bash-2.05a$ 
Script done on Thu Mar 30 21:06:02 2006
bash-2.05a$                               ( Finally back to my live bash shell

The emacs command to get a shell is ESC-x shell.

Then everything you do is in an emacs buffer and you can cut and paste
from it, or just rename the whole thing.

Hope it helps,

Marilyn




>      someprogram > outfile.txt 2>&1
> or
>      someprogram 2>&1 | tee outfile.txt
> but not
>      someprogram 2>&1 > outfile.txt
> 
> The last one confuses me until I think about 2>&1 makes stderr
> go into stdout at the time it is parsed.
> In the last one, stdout has not been redirected to outfile.txt yet,
> so stderr will go to where stdout is (the terminal).
> Best to play around and see.
> 
> Rick
> 
> 
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
> 

-- 





More information about the sf-lug mailing list