$! SUBCMD.COM - Submit command(s) to BATCH $ $! Example: @SUBCMD MAIL PURGE $ $ _On Control_C then _Goto ERROR $ _On error then _Goto ERROR $ $! Find a name for the temporary command file $ Temp = -1 $FIND: $ Temp = Temp + 1 $ File = F$Search("TEMP''Temp'.COM") $ _If File .nes. "" then - _Goto FIND $ $! Open the temp file $ _Open/write 1 TEMP'Temp'.COM $ _Write 1 "$ _Set NoOn" $ $! Parse the command line $ Command = "''p1' ''p2' ''p3' ''p4' " - + "''p5' ''p6' ''p7' ''p8'" $ Command = F$edit(Command,8+16+128+256) $ !Trim the command $ $! Find next line separator (\) $WRITE: $ Pos = F$Instr(1, Command, "\") $ _If Pos .eq. 0 then - Pos = F$Len(Command) + 1 $ $! Write command to temp file & terminal $ Cmd = F$Left(Command,Pos-1) $ _Write 1 Cmd $ _write 0 Cmd $ $! Get remainder of line $ Command = F$Right(Command,Pos+1) $ $! If more, do next line $ _If Command .nes. "" then - _Goto WRITE $ $! Write commands to mail log back to me $ _Write 1 "$ _Close/log" $ _Write 1 "$ _Mail send/noquery/nofile " - + "TEMP''Temp'.LOG to Barton" $ _Write 1 "$ _Delete TEMP''Temp'.LOG" $ _Write 1 "$ _Exit" $ $! Close the temp file & submit it to batch $ _Close 1 $ _Submit/delete TEMP'Temp'.COM $ $ _Exit $ $ERROR: $ _Close 1 $ _Delete/nolog/nowarn TEMP'Temp'.COM $ _Exit