lib/scripts/feeder.pl
author wenzelm
Fri, 16 Apr 2010 10:52:10 +0200
changeset 36162 0bd034a80a9a
parent 29145 b1c6f4563df7
child 39580 05daab5782f6
permissions -rw-r--r--
added ML antiquotation @{make_string}, which produces proper pretty printed version in Poly/ML 5.3.0 or later;

#
# Author: Markus Wenzel, TU Muenchen
#
# feeder.pl - feed isabelle session
#

# args

($head, $emitpid, $quit, $tail) = @ARGV;


# setup signal handlers

sub hangup { exit(0); }
$SIG{'HUP'} = "hangup";
$SIG{'INT'} = "IGNORE";


# main

#buffer lines
$| = 1;


$emitpid && (print $$, "\n");

$head && (print "$head", "\n");

if (!$quit) {
    while (<STDIN>) {
	print;
    }
}

$tail && (print "$tail", "\n");


# wait forever

close STDOUT;
sleep;