[net.unix-wizards] Typescript of simple interactive programs, help wanted

vidar@kvvax4.UUCP (Vidar S|rensen) (02/21/85)

Can someone help me withe the following problem:
 
I want to typescript an interactive C or Pascal program on UNIX (4.1Bsd)
but can't get it to work. The problem is possibly that the i/o goes 
via pipes from/to the script process, but I can't afford the time to
study it. 
Problem examples:
------------------------------------------------
#include <stdio.h>
main()
{
int i;
	printf("number please ");
	while ( scanf("%d",&i) != EOF) {
		printf("That was %d\n",i);
		printf("number please ");
	}
}
------------------------------------------------
program junk(input,output);
var i:integer;
begin
	write('number please?');
	while not eof do begin
		read(i);
		writeln('that was a ',i:2);
		write('number please?');
	end
end
.
-----------------------------------------------
	Vidar Sorensen  ({decvax,philabs}!mcvax!kvport!kvvax4!vidar)
	A/S Kongsberg Vaapenfabrikk, P.O.Box 25, N-3601 Kongsberg