$ was_verify = 'F$VERIFY(0)' $! $! FTOOL.COM parameters $! Build the tool. the parameters are passed to build. The $! build is run a subprocess (using FORK.COM) $! Note: BIN: must be assigned "globally" (i.e., in login.com) $! $ if p1 .eqs. "" then inquire p1 "Enter file to build" $ build -o tool.tm1 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8 'p9 $ if "''f$logical("SYS$PUTMSG")'" .nes. "" then deassign SYS$PUTMSG $ p1 := "TOOL.TM1" ! Cannot be TOOL.TMP $ p2 := "" $ p3 := "" $ p4 := "" $ p5 := "" $ p6 := "" $ p7 := "" $ p8 := "" $ p9 := "" $! $! The remainder of this file is identical to FORK.COM $! $! was_verify = 'F$VERIFY(0)' $! $! FORK.COM runs a command file as a subprocess. Note that it starts $! by running LOGIN.COM to setup locally-managed command names. $! $! If the first character of the first argument passed to FORK is a $, $! it is considered to be a command; i.e., FORK $DIR gets a directory $! in a subprocess. $! $! A log file is produced, whose name is based on the first FORK argument. On $! completion, a message is written to your terminal indicating what happened. $! $ if "''f$logical("SYS$PUTMSG")'" .nes. "" then deassign SYS$PUTMSG $ infilnam := 'p1' $ file_name := 'p1' $ if "''f$extract(0, 1, file_name)'" .eqs. "$" - then file_name := "''f$extract(1, 9999, file_name)'" $ if 'f$locate("::", file_name)' .eq. 'f$length(file_name)' - then goto not_remote $ write SYS$OUTPUT "Sorry, local files only" $ exit 2 $ not_remote: $ i = 'f$locate(":", file_name)' + 1 $ if 'i' .gt. 'f$length(file_name)' then goto no_device $ file_name := 'f$extract(i, 9999, file_name)' $ no_device: $ i = 'f$locate("]", file_name)' + 1 $ if 'i' .le. 'f$length(file_name)' then - file_name := 'f$extract(i, 9999, file_name)' $ i = 'f$locate(">", file_name)' + 1 $ if 'i' .le. 'f$length(file_name)' then - file_name := 'f$extract(i, 9999, file_name)' $ i = 'f$locate(".", file_name)' $ if 'i' .ne. 'f$length(file_name)' then - file_name := 'f$extract(0, i, file_name)' $! $ where_am_i := 'f$logical("SYS$DISK")''f$directory()' $ login_loc := 'f$logical("SYS$LOGIN")' $ cmdfilnam := 'file_name'.tmp $ logfilnam := 'file_name'.log $ tty_ := "''f$logical("SYS$ERROR")'" $ leadin := "$ @" $ if "''f$extract(0, 1, p1)'" .eqs. "$" then leadin := "" $! $ $ open/write cmd 'CMDFILNAM' $ write cmd "$ fork_verify = ''F$VERIFY()'" $ write cmd "$ assign ''login_loc' sys$login" $ write cmd "$ set default sys$login" $ write cmd "$ @login.com ''login_loc' ''file_name'" $ write cmd "$ if 'fork_verify .eq. 1 then set verify" $ write cmd "$ set default ''where_am_i'" $ write cmd "''leadin'''P1' ''P2' ''P3' ''P4' ''P5' ''P6' ''P7' ''P8'" $ write cmd "$ if $status then goto success" $ write cmd "$ s := ""'", "'$", "status'""" $ write cmd "$ reply/term=''tty_' ", - """''INFILNAM' failed, status = '","'s'", - ", log in ''f$directory()'''LOGFILNAM'""" $ write cmd "$ reply/term=''tty_' ""'","'F$MESSAGE(S)'""" $ write cmd "$ goto done" $ write cmd "$success:" $ write cmd "$ reply/term=''tty_' ", - """''INFILNAM' completed successfully, log in ''f$directory()'''LOGFILNAM'""" $ write cmd "$done:" $ write cmd "$ delete/log ''CMDFILNAM';" $ write cmd "$ logout/full" $ close cmd $ run sys$system:loginout /sub=0 /page=5120 /buf=2048 - /input ='cmdfilnam' - /output='logfilnam' - /error='logfilnam' $ write sys$output "[Log file is ''logfilnam']" $ if 'was_verify' then set verify