On Sun, 26 Dec 1999, Kevin Sexton wrote:
>I have prime95 running on win95, and have set up mandrake,
>and I want mprime to continue the work, right now, linux is
>only run a minority of the time, and I haven't set up a
>compatible modem, but this will change. I am new to linux,
>and so I don't know the details of how to set it up in the
>scripts, ect.
Put mprime in the same directory as prime95 (mine is /win/mersenne). I start
mprime from rc.local, though it would be better to start it from a script in
init.d as then if I switch runlevels I wouldn't end up with two mprimes running
at once.
/win/mersenne/mprime -d |/usr/local/bin/runtail 25 /win/mersenne/primelog &
runtail is a Tcl script which is attached. You may want to run mprime on a
virtual console or from screen.
phma
#!/usr/bin/tclsh
# Reads standard input and writes the last n lines to a file.
# Usage: runtail n file
proc outem {} {
global n ;
global file;
global line ;
set f [open $file w];
for {set i 0} {$i < $n} {incr i} {puts $f $line($i)};
close $f;
}
proc scroll {str} {
global n;
global line;
for {set i 1} {$i < $n} {incr i} {set line([expr $i - 1]) $line($i)};
set line([expr $n - 1]) $str;
}
foreach {n file} $argv {}
for {set i 0} {$i < $n} {incr i} {set line($i) ""}
while {1} {
scroll [gets stdin];
outem;
}