Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.wizards Subject: Re: Utility to keep all typed command lines. Summary: ... why my UNIX World subscription lapsed. Message-ID: <17538@rpp386.cactus.org> Date: 3 Jan 90 06:25:58 GMT References: <1527@utkcs2.cs.utk.edu> <1990Jan2.180615.28396@ux1.cso.uiuc.edu> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Organization: Lone Star Cafe and BBS Service Lines: 34 In article <1990Jan2.180615.28396@ux1.cso.uiuc.edu> gorham@uiucme2.UUCP (Gorham P. Miscall) writes: >In article <1527@utkcs2.cs.utk.edu> battle@alphard.cs.utk.edu (David Battle) writes: >>I would like to have an accounting utility which will keep not only >>the name of the command run but also the arguments, especially for commands >>typed at a shell by a human (as opposed to coming from a command file). > > The following was taken out of the January issue of UNIX World. It >works very well for me: > > This captures all I/O of a terminal session to "Capture.file" > > tee -a Capture.file | sh -i 2>&1 | tee -a Capture.file > >Hope this does the trick for you! Not likely. This command will have the nasty side-effect of causing your standard input and standard output to no longer be terminals. Try editing a file using vi in such a capture program. For a capture program to really work it needs to use pty's. Pipes won't cut it. The trick is to grab a pair [ one for input, the other for output ] of ptys. On one end you read from the original input in raw mode, and shove it through the pty. The other end reads the output of the pty. Both ends have a file open for append which they duplicate all of the characters each sees into it. Writes on this capture file are unbuffered to preserve the relationship between the characters. For more details see the Berkeley script command. I also have one using pipes, but as I mentioned above, it doesn't work completely. -- John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 832-8832 Domain: jfh@rpp386.cactus.org