![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2004
Posts: 2
Rep Power: 0
![]() |
Hello,
I tried to do a small perl script to check if amule is running and if it's not to launch it, but that's not working... I never ever programmed in perl before, it must be a dumb error, but I can't find it any idea? #!/usr/bin/perl
$cmd="ps -A | grep amule | grep -v grep";
$output=qx/$cmd/;
if ($output!=~m/$amule/) {
qx/amule/;
}Thxs Ludo |
|
|
|
|
|
#2 |
|
PFO Founder
![]() ![]() |
could you help us out by letting us know what kind of error you are getting when you try to run the program that will help a lot, thanks
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jun 2004
Posts: 2
Rep Power: 0
![]() |
Basically, it gives no error but does nothing
I am kind of sure that the problem come from the 2 first lines... $cmd="ps -A | grep amule | grep -v grep"; $output=qx/$cmd/; cos if I try only that in the script, it only takes the ps -A part, as if it cut aftyer the | Ludo btw, i'm the owner of MythTVtalk.com ![]() |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5
![]() |
The problem is that $output!=~m/$amule/ is not correct ... instead of !=~ you should have used !~ ... so: $output !~ m/$amule/
__________________
[ [ SykkN alloc ] initWithThePowerTo: destroyYouAll ]; /* Don't make me use it! */ |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|