1 #!/usr/local/bin/perl -s
6 $xskip = ( $^O eq 'solaris' ) ? 600 : 500 ;
8 use File::Basename qw( basename );
9 $ENV{PATH} .= ':' . basename( $0 ) . ':.';
10 for my $prog qw( run_stem xterm telnet ) {
11 die "Can't find $prog in PATH\n" if
12 system( "which $prog >/dev/null 2>&1" ) != 0;
17 $SIG{ 'INT' } = \&cleanup ;
22 $prompt = '-prompt Stem:' ;
23 $prompt2 = '-prompt Chat:' ;
24 $echo = 'console_echo=1'
27 foreach $cmd ( split /\n/, <<EOT ) {
28 xterm -T Chat1 -n Chat1 -geometry 80x25+XSKIP+0 -e $ssfe $prompt run_stem $echo chat_server
29 xterm -T Chat2 -n Chat2 -geometry 80x25+XSKIP+250 -e $ssfe $prompt run_stem $echo chat_client
30 xterm -T A -n A -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6666
31 xterm -T B -n B -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6667
32 xterm -T C -n C -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6668
33 xterm -T D -n D -geometry 80xLINE+0+OFF -e $ssfe $prompt2 telnet localhost 6669
36 $cmd =~ s/XSKIP/$xskip/ ;
38 $cmd =~ s/LINE/$line_cnt/ ;
39 $cmd =~ s/OFF/$base_off/ and $base_off += $offset ;
43 @cmd = split ' ', $cmd ;
48 sleep 2 unless $cmd =~ /localhost/ ;
71 if ( $pid = fork() ) {
73 push @children, $pid ;