$ 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. $! $ use_send = "''is_rex'" .nes. "" ! False => REPLY/TERM $ if 'use_send' then send_process := 'f$process() $ 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:" $ if 'use_send' then goto do_send $ write cmd "$ reply/term=''tty_' ", - """''INFILNAM' completed successfully, log in ''f$directory()'''LOGFILNAM'""" $ goto do_done $ do_send: $ write cmd "$ send ''send_process' ", - """''INFILNAM' completed successfully, log in ''f$directory()'''LOGFILNAM'""" $ do_done: $ 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