Not another ksh!

Hi there,
I've coded a script to create a menu system on an AIX machine.

When user selects an item of the menu I perform a program using " nohup somepgm &"

The reason I do that is because usually the scripts behind the menu items are very time-consuming and users logout and log back in later to see the result and if I don't use "nohup" the programs stop after user logout...

Am I right? Any suggestion?

OK, the problem is here... When you exit from the menu program and get back to command line "jobs" command doesn't show the job is running (because when it gets kicked off by the menu system and nohup a new ksh opens and runs the program)

How can I nohup the programs from the menu system in the way that I can see the job is running... I mean is there any way to nohup the program in the same ksh as the menu system.

Thank you in advance...

Guys...
I've tried { nohup somepgm & } and still it opens another ksh...

Take a look at the parent process ID of the jobs you have applied nohup to after you logout and come back online. I dont think your process will own the jobs anymore, I think they are passed off to the INIT process. This would explain why you cannot see the jobs running when you type in the jobs command. However, output of your jobs are sent to $HOME/nohup.out (this can be redirected if you so choose - see man nohup).

Capture the process ID when you place the process in the background and then poll that with kill -0 $LAST_BACKGROUND_ID this will tell you if the job is still running. Of course this will complicate your script quite a bit having to manage these temp files by user...Im sure there is a better way to do this.