pid of nohup process

I want to print the pid of a nohup process to a file so later I can use the list of pid's in that file to stop the background processes again.

I use ksh on AIXv5.3:

nohup /start/script.ksh 1>/dev/null 2>&1
print $$ > .pid

nohup /start/script2.ksh 1>/dev/null 2>&1
print $$ >> .pid

But in the .pid file I get the pid of the script that contains the nohup statements instead of the pid of the nohup statement, what I would expect.

$$ gives you the pid of the current shell that is why it is giving you the pid of the script or session that is calling the nohup statement. you need to place the print $$ within script.ksh and script2.ksh or you will have to get the pid list of the child processes of the current shell. I'll try to paste that part once I figure it out ... but for now see if it is feasible to place those commands within script.ksh and script2.ksh.

hope this helps,
Vj

got it ....
$! gives the child pid .....

nohup /start/script.ksh 1>/dev/null 2>&1
print $! > .pid

nohup /start/script2.ksh 1>/dev/null 2>&1
print $! >> .pid

Vj