How to capture or redirect /dev/tty

Empty plug at emptiedout.com
Fri Dec 29 09:35:41 MST 2006


vodhner at cox.net wrote:

> I thought I'd use the "screen" command and turn on logging, but "screen" buffers its output to disk so the final 10 lines of warning messages are lost.  I solved that problem, this time, by re-running the test and transcribing those last 10 lines from the frozen screen onto paper.
> 
> Is there a way to force /dev/tty to disk, unbuffered?  Could I munge the "controlling terminal" identity so output goes to disk?

Check out 'script -f'.  I think it does pretty much what you want...


benb at nulled:~$ script -f
Script started, file is typescript
benb at nulled:~$ cat foooooooooo
cat: foooooooooo: No such file or directory
benb at nulled:~$ echo fooooooooo
fooooooooo
benb at nulled:~$

(different terminal than the one running script- with -f especially you
will find yourself in an infinite recursion loop where the file is
growing as fast as it is catting :-/ The below output was taken less
than a second after "echo fooooo" returned)

benb at nulled:~$ cat typescript
Script started on Fri 29 Dec 2006 09:33:11 AM MST
benb at nulled:~$ cat foooooooooo
cat: foooooooooo: No such file or directory
benb at nulled:~$ echo fooooooooo
fooooooooo
benb at nulled:~$ benb at nulled:~$


Hope that helps!

~Ben

-- 
---
"Confession only helps if you actually feel bad for your actions.
For you, it would just be a really long boast."
	-Tara
http://www.emptiedout.com


More information about the PLUG-discuss mailing list