[Info-vax] Check if a process will auto-terminate
sapienzaf
sapienza at noesys.com
Tue Apr 28 13:42:23 EDT 2009
On Apr 28, 1:21 pm, Joseph Huber <joseph.hu... at NIRWANA.web.de> wrote:
> Of course it does, the second @CMD executes in the master process, the
> first one is a subprocess of a different master process.
No, it doesn't. You're not understanding the original question.
In an interactive session, if you type $SPAWN on a command line all by
itself then the next line of input is handled by the spawned sub-
process.
Thus, in:
$ spawn
$ @cmd
$ ... <other commands executed in the sub-process>
$ logout <returns control to the parent>
The @CMD is processed in the context of the sub-process and it will
have the master pid of its parent. The parent is hibernating, waiting
for the sub-process to complete. When the @CMD completes control
stays in the sub-process.
In:
$ spawn @cmd
The execution environment is the same. That is, the @CMD is executed
in the sub-process and it has a hibernating parent. However, as soon
as the @CMD completes control is returned to the parent.
The original question was how to differentiate those two cases. From
within the CMD procedure, how can it determine whether control will
return to the parent once it completes, or whether control will remain
in the subprocess.
I'm not sure it can be done.
More information about the Info-vax
mailing list