troubleshooting Question

Need help to read Perl script.

Avatar of SAM2009
SAM2009Flag for Canada asked on
PerlJavaScripting Languages
5 Comments1 Solution26 ViewsLast Modified:

Hi,


I'm not Perl expert so I need help to read this script. Is someone can tell me line by what it does?:


---------------------------------------------------------------------------

my $javab = "/apps/App/Sterling/jdk/bin/java";
$wmsproc = "ps -ef |egrep -v 'grep|perl' | grep $javab | grep $search |";


open(PROCESS,$wmsproc) || die "Unable read pipe\n";
while ($line = <PROCESS>) {
                          
                     $pid = substr($line,9,5);
                     print "Message.1: Process Java $search found pid is $pid \n";
                     print "Statistic.1: $pid\n";
                     print "Message.2: Process Java $search found  $line \n";
                     print "Statistic.2: $line\n";
                     exit 0;
               
}
print "Statistic: 0\n";
exit 1;

---------------------------------------------------------------------------

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros