X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=bin%2Fhello_demo;fp=bin%2Fhello_demo;h=313c5c1e7b658563299534627e47946f84367813;hb=d88e43718237ee11b2a4458ed280dccfe6aea2d7;hp=5b525c1783eb34d5752c4016877550affa3da73a;hpb=6b7be1100e75ca4ac0b5b9a3811dee268fafe2b6;p=urisagit%2FStem.git diff --git a/bin/hello_demo b/bin/hello_demo old mode 100644 new mode 100755 index 5b525c1..313c5c1 --- a/bin/hello_demo +++ b/bin/hello_demo @@ -4,13 +4,15 @@ use strict ; use warnings ; our $s ; -if ( -d 'conf' && -e 'bin/run_stem' ) { +print "HELLO DEMO\n" ; - $ENV{PERL5LIB} = 'lib' ; - $ENV{PATH} = "bin:$ENV{PATH}" ; +use File::Basename qw( basename ); +$ENV{PATH} .= ':' . basename( $0 ) . ':.'; +for my $prog qw( run_stem xterm ) { + die "Can't find $prog in PATH\n" if + system( "which $prog >/dev/null 2>&1" ) != 0; } -print "HELLO DEMO\n" ; $SIG{ 'INT' } = \&cleanup ; @@ -30,12 +32,11 @@ s/:/: / for @cmd ; fork_exec( @cmd ) ; -while( ) { +1 while wait() != -1; + +exit; - next unless /^q/i ; - cleanup() ; -} sub cleanup {