Re: Check if a process will auto-terminate



On Apr 30, 1:27 pm, "Stephen Davies" <no...@xxxxxxxxxxx> wrote:
"AEF" <spamsink2...@xxxxxxxxx> wrote in message

news:83c3a47f-8702-47c1-a19c-e112a0fc3b9d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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
.



Relevant Pages

  • Re: Check if a process will auto-terminate
    ... then exit when called like this: ... $ spawn @CMD ... $ IF THEN GOTO PART1 ... $ WRITE SYS$OUTPUT "PART 1 BEG" ...
    (comp.os.vms)
  • Re: Check if a process will auto-terminate
    ... $ IF THEN GOTO _WAIT ... Alas no, because that would mean that CMD always waits for ... But I want CMD to wait for CMD_SUB when called like this: ... $ spawn @CMD ...
    (comp.os.vms)
  • Re: [PATCH #2] Re: SATA and 2.6.0-test9
    ... The 4th port seems to ... ata_bus_reset: EXIT ... ata_exec_command_mmio: ata1: cmd 0xEC ... ata_device_add: ata4: probe-wait begin ...
    (Linux-Kernel)
  • Re: Is David Fenton right about error handling? (re-post?)
    ... > Error Goto 0 a proper termination. ... after the Exit Function. ... Clears all property settings of the Err object. ... Exit Sub, Exit Function, Exit Property ...
    (comp.databases.ms-access)
  • Re: On Local Error Goto Somewhere
    ... an EXIT DO or EXIT FOR. ... going if there is no label to show you the destination. ... IMO the GoTo statement has never been "THE" problem. ... ON ERROR GOTO MySubErr Dim lFNbr as long ...
    (microsoft.public.vb.general.discussion)