#!/usr/bin/perl -w $waitingFile = shift; exit unless defined($waitingFile); $waitingFile = "./$waitingFile" unless ($waitingFile =~ m|/.*|); print "Testn"; system "/bin/chmod -f u+x $waitingFile; $waitingFile"; $testPID = `/bin/ps -x | /usr/bin/grep $waitingFile | /usr/bin/grep -v grep | cut -c 1-5`; $testPID+=0; system "echo PID=$testPID"; if ($testPID) { system "/bin/sleep 3 ; /bin/kill $testPID "; }else{ exit -1 }