[Info-vax] Check if a process will auto-terminate

AEF spamsink2001 at yahoo.com
Thu Apr 30 21:48:23 EDT 2009


On Apr 30, 1:27 pm, "Stephen Davies" <no... at nowhere.com> wrote:
> "AEF" <spamsink2... at yahoo.com> wrote in message
>
> news:83c3a47f-8702-47c1-a19c-e112a0fc3b9d at s1g2000prd.googlegroups.com...
>
> >Steve,
>
> >Does this do what you need?
>
> >$ TYPE CMD*.COM
>
> >DISK$DATA1:[FELDMAN.VMS.DCL.SPAWN]CMD.COM;1
>
> >$ SPAWN/NOWAIT @CMD_SUB.COM
> >$_WAIT:
> >$ WAIT 0:00:01
> >$ NUMSUB = F$GETJPI("","PRCCNT")
> >$ IF (NUMSUB.GT.0) THEN GOTO _WAIT
>
> Alas no, because that would mean that CMD always waits for
> CMD_SUB to finish.
>
> What I want is for CMD to do "spawn/nowait @CMD_SUB" and
> then exit when called like this:
> $ @CMD
>
> or like this:
> $ spawn
> $ @CMD
>
> But I want CMD to wait for CMD_SUB when called like this:
> $ spawn @CMD
>
> or like this:
> $ spawn /nowait @CMD

Does this do what you want? (Put commands for the CMD.COM in part 1
and those for CMD_SUB.COM in part 2.)

$ TYPE CMD2.COM
$ IF (P1.EQ.1) THEN GOTO PART1
$ IF (P1.EQ.2) THEN GOTO PART2
$ SPAWN @CMD2.COM 1
$ SPAWN @CMD2.COM 2
$ EXIT
$
$PART1:
$ WRITE SYS$OUTPUT "PART 1 HERE"
$ EXIT
$
$PART2:
$ WRITE SYS$OUTPUT "PART 2 HERE"
$ EXIT
$

It's late. I hope I got it right! :-)

The only problem I see is that you don't get the prompt string for the
first command you run after the SPAWN/NOWAIT run. 'Hope that's not a
problem!

AEF



More information about the Info-vax mailing list