[net.unix] Wanted: UNIX interactive terminal session logger

fdf@houxa.UUCP (11/12/83)

I am interested in obtaining a program or set of commands that will
allow me to log the results of an interactive terminal session to a
file. Specifically, I am running a c program that I cannot alter
and I would like to be able to have the commands I input and the
response it gives written to a single file (in real time order)
along with appearing on the terminal. I have tried:

	tee -a file | a.out | tee -a file

but either the pipe mechanism or tee itself is buffered, so
the terminal and the file do not get commands and responses in the
same order as when

		a.out

is executed.

What I am looking for is similar to a program called "photo" that ran
on a DEC-10 I used a few years ago at Vanderbilt (Rutgers has one, too).

I am running UNIX 5.0 on a VAX (of course, UNIX is a trademark of
AT&T Bell Laboratories, and VAX is a trademark of Digital Equipment

Frank Fite
AT&T Bell Laboratories, Holmdel NJ
201-949-1240
ihnp4!houxm!houxa!fdf (or something similar)

dyer@wivax.UUCP (Stephen Dyer) (11/12/83)

Bruce Borden did this for the Harvard UNIX systems long ago, and it's
been carried over to their 2.9BSD/4.1BSD systems.  It involves some
minor kernel mods--essentially, one can associate a "protocol" file handle
with a primary file handle, so that the protocol file is written upon
automatically whenever a write OR read operation occurs on the primary
file.  In other words, when you read or write data to the primary file,
the protocol file receives a copy of that data.

The user interface looks like this:

% monitor arbitrary-unix-command > protocolfile
(the standard output is restored to that of the terminal after the
 protocol file is assigned.  Any reads or writes to standard input,
 standard output or standard error are placed into the protocolfile.)

This works incredibly well whenever you need a copy of a complete session
saved for later printout (of course, screen operations don't make much
sense on a line printer.)  It really is a good counter-example to those
who always argue "keep it out of the kernel"--"tee" and pipes just can't
do the job here.  At Harvard, it's been used by students for the past 9
years.

Contact John Park at the Harvard Science Center for info.
His net address is "decvax!genrad!wjh12!unixvax:park".

/Steve Dyer
decvax!bbncca!sdyer

mark@cbosgd.UUCP (Mark Horton) (11/14/83)

Why doesn't somebody with a 4.1BSD system post script.c?  (It's
a public domain program - I wrote it years ago, but didn't keep
a copy.)

The 4.2BSD script program uses ptys instead of pipes - this is
a big improvement because programs don't stop buffering, and
ioctls work (so you can script a vi session).  Alas, this means
it won't port back to a USG or V7 or 4.1BSD system.  This version
of script produces an exact typescript - this is great for debugging
obscure programs, but it also puts ^M at the end of every line,
and saves the ^H ^H echos when you make a typo in cooked mode.

bbanerje@sjuvax.UUCP (B. Banerjee) (11/14/83)

OK,  I'm posting Mark Horton's script.c to net.sources.  I
trust that Mark, Berkeley or Bell have no designs on my
pitiful savings, and won't consider legal action.

(Just kidding folks!).

-- Binayak Banerjee
{bpa!astrovax!burdvax}!sjuvax!bbanerje