CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
PID and get



Apr 23, 2001, 5:26 PM

Post #1 of 2 (231 views)
PID and get Can't Post

Hi .
I have 2 problems.
The first one is:
I have a program called ktop and I want to kill it by using perl.
But how do i send a kill signal to ktop.
I only know how to send it if I have the PID but what do I write if I want to
kill it by it's name ?

The second one is:
I want to open up a webpage with perl.
It looks like
system("netscape http://xxxxx/xxxx/oo&query=text");
Everything after the & sign just fades away.
How do I send th whole url ?

Cheers !


Apr 23, 2001, 11:09 PM

Post #2 of 2 (224 views)
Re: PID and get [In reply to] Can't Post

Regarding the first problem:

One of my first experiments was kind of pkill (before I even knew there is such a thing) - script that kills process(es) by name and I was using theresults of ps command.
I'm attaching the script, though I would advise against learning from it because, altough it works all right, it's not written as it should be and instead using some basic Perl functions it uses system calls, e.g. it uses system kill instead Perl kill() and ignores -w and use strict.

Regrding the second one:

1. Try using 'single quotes' around the command instead of "double quotes" or precede the ampersand with a backslash, like \&.

2. Are you sure you're using the -w switch in the script ?

Jean Spector
QA Engineer @ Extent Technologies, Ltd.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives