On 6/22/06, Gopalarathnam Venkatesan <gopal@xxxxxxxxxxxxxxxxx> wrote:
R.Ramkumar wrote:
shell..echo $$
thats only the pid of the shell. as the faq mentioned by you says, u
have to grep thru ps for this pid.
that reminds me of the short cut for linux systems.
`cat /proc/$$/exe`... gives u the path to the executable.
read the file /proc/$$/cmdline till the first \0 for argv[0] of the
"$$" is pid of the parent process, if you say "echo $$" from the shell
prompt after logging in, it is the process id of the parent shell.
pid of the shell that was used to run the program.