----- Original Message ----- From: "Jacques Lederer" <[EMAIL PROTECTED]> To: "Paul Johnson" <[EMAIL PROTECTED]> Sent: Sunday, January 19, 2003 8:32 PM Subject: Re: pid
> OK. Thanks very much, the eval thing does work. > I have another one now, on another subject. On a linux box, I am trying to > get a simple way to get automatically the pid of a process that I am > starting. You will say this is very easy, with open or fork. However the > problem is that I have to start a series of processes: "cd my_directory; > cmd" What I need is the pid of "cmd", and not the pid of "cd my_directory". > And if I do something like > system "cd my_directory"; > $pid = open ("cmd |"); then the "cd my directory" is useless, because this > is now another shell, and "cmd" doesn't work as it is not being executed in > my_directory. :-( > Then the next situation is when "cmd" is actually a script in which there is > a command like > "java -jar stuff.jar args this and that &", and what I want is the pid of > this java. (when there are already other java processes running on the box) > I have solved the problem in a rather circumvoluted and complicated way that > works, however again I do feel I may have missed a simple easy way to do it. > What I mean is not to manually get the pid with ps -ef, but to automatically > get it so it can be used in a script.which I can then use to check the satus > of or kill the process. > > Jacques L > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]