open(PS_F, "ps -auwwx | grep inder |") || die "Can't open console\n"; while () { (undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$comm,$comm1,$comm2) = split; $comm .= ' '.$comm1.' '.$comm2; if($comm =~ m/Theservice.pl /i) { print "Service Already Running\n"; } print $comm, "\n"; } close(PS_F);