[RndTbl] UNIX command transcript with canned input, echoed in output?

Peter O'Gorman peter at pogma.com
Fri Nov 25 20:56:50 CST 2011

On 11/25/2011 03:26 PM, Gilbert E. Detillieux wrote:
> On 2011-11-25 14:55, Adam Thompson wrote:
>> Seems like a strange thing to ask for - how would you discriminate
>> between
>> input and output, since they'd likely be interleaved?
> Actually, the whole point is to have the echoed input interleaved with
> the output, i.e. inserted where it belongs in the sequence.
> Since the Prolog interpreter issues a prompt, this would make it fairly
> easy to distinguish input from output in the transcript, without the
> need for highlighting.

I don't see a way to do this with the standard tools either.

This is a very slightly modified script from the python pty example at:

Accept `-c command' to set the executable.
Also copy stdin to the output if input is not a tty.

So use it just like script(1) but stdin can be a file, and will be 
copied to the output file. Just like script, it will keep going until 
the spawned process quits.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pscript
URL: <http://www.muug.mb.ca/pipermail/roundtable/attachments/20111125/b47a92b5/attachment.ksh>

More information about the Roundtable mailing list