![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to monitor process running on server and posting a mail if any process is dead | pradeepmacha | Shell Programming and Scripting | 13 | 03-06-2009 07:33 AM |
| [PERL] Running unix commands within Perl Scripts | userix | Shell Programming and Scripting | 1 | 05-28-2008 07:06 PM |
| How to create a dummy process of a process already running? | shambhu | UNIX for Advanced & Expert Users | 3 | 08-31-2007 11:22 AM |
| daemon running in AIX checking | karthikosu | UNIX for Dummies Questions & Answers | 0 | 10-24-2006 01:49 PM |
| checking for a running process from korn cron | jph | Shell Programming and Scripting | 2 | 05-01-2005 01:27 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
perl scripting for checking if a process is running
Hi All,
I am new to perl and have been trying to write a short script to check a process.Though i havent reached to the stage where i can match the output. I am trying to pass a variable x with value /opt/RGw/csbp-base/CSBP_BAT.01.00.05/csbp_BAT.01.00.05.jar and then pass another variable y to check if the process is running in the system ps -ef | grep -i "csbp_BAT.01.00.05.jar" | grep -v grep |awk -F" " '{print $11}' Though this command works from the command line.but if i run and print the same via the script i get all messed up #!/usr/bin/perl $x="/opt/RGw/csbp-base/CSBP_BAT.01.00.05/csbp_BAT.01.00.05.jar"; $y=`ps -ef | grep -i "csbp_BAT.01.00.05.jar" | grep -v grep |awk -F" " '{print $11}'`; print "\n"; print "$x \n"; print " \n"; print "$y"; print "\n"; #echo $y; #if [$x=$y]#then # echo "1st step completed" # echo "let me try somemore" #else #echo "try again" #echo "will need to see how it works" #fi #exit Thanks in advance for clearing my doubts. Br/// pistachio |
| Bookmarks |
| Tags |
| perl, process monitor |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|