in reply to Creating process restart script
All statements in Perl must end with a semicolon.
You need to use a string comparison operator (eq) instead of the assignment operator (=) in your if statement.
Using the strictures (use warnings; use strict;) will help avoid other common mistakes.
I think this is more like what you wanted:
#!/usr/bin/perl use warnings; use strict; my $com1 = `ps -eaf | grep bpps | grep -v grep | awk '{print $1}'`; my $com2; if ($com1 eq 'weblogic') { print "bpps is running.\n"; } else { $com2 = `sh -c /export/home/weblogic/bai/bpps.sh start 2 > /de +v/null 2>&1`; }
This code is untested.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating process restart script
by redcell184 (Initiate) on Oct 31, 2007 at 17:07 UTC | |
by toolic (Bishop) on Oct 31, 2007 at 17:35 UTC | |
by redcell184 (Initiate) on Nov 01, 2007 at 06:13 UTC | |
by toolic (Bishop) on Nov 01, 2007 at 13:57 UTC | |
by redcell184 (Initiate) on Nov 01, 2007 at 20:27 UTC |