Ferman <ferhat_torgaloz@hotmail.com> scribbled the following:
> Hi,
> I found a solution. I run a command by exec() on UNIX OS.
> program part like this;
> try
[quoted text clipped - 13 lines]
> System.out.println(e);
> }
> But it is give me "$$" characters. I didn't obtain the process id. What is
> the problem ?
> OS: SunOS
The "$$" is a feature of the shell. However, processes run with
Runtime.exec() run directly on the OS, not in any shell. Therefore
your solution won't work. You could try executing a batch file that
executed "echo $$ >somefile" and then read somefile back in on the
Java side, but I'm not sure if that gets you the correct process ID.
For the really adventurous, write your own shell, which has some kind
of interface to return its process ID. Then call that interface from
Java via JNI or something.

Signature
/-- Joona Palaste (palaste@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Hasta la Vista, Abie!"
- Bart Simpson