Trailing-Edge
-
PDP-10 Archives
-
integ_tools_tops20_v7_30-apr-86_dumper
-
tools/rev/rev.com
There are 3 other files named rev.com in the archive. Click here to see a list.
$!REV.COM Terry J. Pettit, Giles Atkinson
$
$ SAY0:='SAY'
$ IF SAY0 .EQS. "" THEN SAY:=="WRITE SYS$OUTPUT"
$ EDIT0:='EDIT'
$ EDIT:=EDIT
$
$ SAY " REV v3.5"
$
$ SELECT_PROC:='REV_SELECT'
$ SELECT_DISABLED:=FALSE
$ IF SELECT_PROC .EQS. "" THEN SELECT_DISABLED:=TRUE
$ SELECTED:==TRUE
$
$ P1:='F$PARSE(P1,"*.*;*")
$ DEVNAM:='F$PARSE(P1,,,"DEVICE")
$ DIRNAM:='F$PARSE(P1,,,"DIRECTORY")
$ SAY " ''DEVNAM'''DIRNAM'"
$
$NEXT:
$ FFNAME:='F$SEARCH(P1,1)
$ IF FFNAME .EQS. "" THEN GOTO X_EXIT
$ FNAME:='F$EXT(F$LOC("]",FFNAME)+1,100,FFNAME)
$ IF SELECT_DISABLED THEN GOTO PROMPT
$ IF F$SEARCH(SELECT_PROC,3) .NES. "" THEN @'SELECT_PROC' 'FFNAME'
$ IF .NOT. "''SELECTED'" THEN GOTO NEXT
$
$PROMPT:
$ ON CONTROL_Y THEN GOTO PROMPT
$ FILNAM:="''FNAME' ''F$FI(FFNAME,"EOF")' ''F$FI(FFNAME,"CDT")' > "
$ READ/END=X_EXIT/PROMPT="''FILNAM'" SYS$COMMAND CMD
$ IF CMD .EQS. "" THEN GOTO NEXT
$ IF CMD .EQS. "@" THEN GOTO X_AT
$ IF CMD .EQS. "?" THEN GOTO X_QUERY
$ SET MESS/NOF/NOS/NOI/NOT
$ ON WARNING THEN GOTO AMBIG
$ SET ON
$ GOTO X_'CMD'
$
$!**** @ ****
$X_AT:
$ SET NOON
$ SET MESS/F/S/I/T
$ @'FNAME'
$ GOTO PROMPT
$
$!**** APPEND ****
$X_APPEND:
$X_APPEN:
$X_APPE:
$X_APP:
$X_AP:
$X_A:
$ SET MESS/F/S/I/T
$ SET NOON
$ INQU TO " APPEND ''DEVNAM'''DIRNAM'''FNAME' to"
$ APPEND 'DEVNAM''DIRNAM''FNAME' 'TO'
$ GOTO PROMPT
$
$!**** BLANK ****
$X_BLANK:
$X_BLAN:
$X_BLA:
$X_BL:
$ SET NOON
$ SET MESS/F/S/I/T
$ SAY "[2J[H"
$ GOTO PROMPT
$
$!**** COPY ****
$X_COPY:
$X_COP:
$X_CO:
$X_C:
$ SET MESS/F/S/I/T
$ SET NOON
$ INQU CMD " COPY ''DEVNAM'''DIRNAM'''FNAME' to"
$ COPY 'DEVNAM''DIRNAM''FNAME' 'CMD'
$ GOTO PROMPT
$
$!**** DELETE ****
$X_DELETE:
$X_DELET:
$X_DELE:
$X_DEL:
$ SET NOON
$ SET MESS/F/S/I/T
$ DELETE 'DEVNAM''DIRNAM''FNAME'
$ GOTO NEXT
$
$!**** DIRECTORY ****
$X_DIRECTORY:
$X_DIRECTOR:
$X_DIRECTO:
$X_DIRECT:
$X_DIREC:
$X_DIRE:
$X_DIR:
$ SET NOON
$ SET MESS/F/S/I/T
$ CUREXT:='F$PARSE(FNAME,,,"TYPE")
$ IF CUREXT .NES. ".DIR" THEN GOTO THIS_DIR
$ NEWSPEC:=="[''F$EXTRACT(1,F$LENGTH(DIRNAM)-2,DIRNAM)'.''F$PARSE(FNAME,,,"NAME")']"
$ DIR 'DEVNAM''NEWSPEC'
$ SAY ""
$ GOTO PROMPT
$
$THIS_DIR:
$ DIR 'DEVNAM''DIRNAM'
$ SAY ""
$ GOTO PROMPT
$
$!**** DUMP ****
$X_DUMP:
$X_DUM:
$X_DU:
$ SET NOON
$ SET MESS/F/S/I/T
$ DUMP 'DEVNAM''DIRNAM''FNAME'
$ GOTO PROMPT
$
$!**** EDIT ****
$X_EDIT:
$X_EDI:
$X_ED:
$ SET NOON
$ SET MESS/F/S/I/T
$ ASSIGN/USER TT SYS$INPUT
$ EDIT/EDT/NOJOURNAL/COMMAND=SYS$LOGIN:EDTINI.EDT 'DEVNAM''DIRNAM''FNAME'
$ SAY ""
$ NNAME:='F$SEARCH(F$EXTRACT(0,F$LOCATE(";",FNAME),FNAME),2)
$ IF NNAME .EQS. FFNAME THEN GOTO PROMPT
$ GOTO NEXT
$
$!**** ENTER ****
$X_ENTER:
$X_ENTE:
$X_ENT:
$X_EN:
$ SET NOON
$ SET MESS/F/S/I/T
$ CUREXT:='F$PARSE(FNAME,,,"TYPE")
$ IF CUREXT .NES. ".DIR" THEN GOTO NOT_DIR
$ NEWSPEC:=="[''F$EXTRACT(1,F$LENGTH(DIRNAM)-2,DIRNAM)'.''F$PARSE(FNAME,,,"NAME")']"
$ 'REV' 'DEVNAM''NEWSPEC'
$ SAY ""
$ SAY "%REV-I-ENTRET, Looking at ''DEVNAM'''DIRNAM' again"
$ GOTO PROMPT
$
$NOT_DIR:
$ SAY "%REV-E-NOTDIR, Current file is not a subdirectory"
$ SAY ""
$ GOTO PROMPT
$
$!**** EXIT ****
$X_EXIT:
$X_EXI:
$X_EX:
$ SET NOON
$ SET MESS/F/S/I/T
$ S:='SELECTED'
$ IF S .NES. "" THEN DEL/SYM/G SELECTED
$ IF EDIT0 .NES. "" THEN EDIT:='EDIT0'
$ SAY "[REV: exit]"
$ EXIT
$
$!**** FULL ****
$X_FULL:
$X_FUL:
$X_FU:
$X_F:
$ SET NOON
$ SET MESS/F/S/I/T
$ DIRE/FULL 'DEVNAM''DIRNAM''FNAME'
$ SAY ""
$ GOTO PROMPT
$
$!**** HELP ****
$X_HELP:
$X_HEL:
$X_HE:
$X_H:
$ SAY "? display list of commands"
$ SAY "@ execute command procedure"
$ SAY "<CTRL/Z> exit"
$ SAY "<CR> next file"
$ SAY "APPEND append current file to another (name on next line)"
$ SAY "BLANK clear screen"
$ SAY "COPY copy to new file (new name on next line)"
$ SAY "DELETE delete current file"
$ SAY "DIRECTORY show files in main directory, or current subdirectory"
$ SAY "DUMP dump current file"
$ SAY "EDIT edit current file (with EDT)"
$ SAY "ENTER do a REV *.* on current subdirectory"
$ SAY "EXIT exit from REV"
$ SAY "FULL full directory of current file"
$ SAY "HELP print this text"
$ SAY "NOSELECT disable the USP facility
$ SAY "PARENT set uic of current file to that of the directory"
$ SAY "PRINT print current file on SYS$PRINT"
$ SAY "PROTECT change protection (new code on next line)"
$ SAY "PUSH DCL command processor"
$ SAY "RENAME rename current file (new name on next line)"
$ SAY "RUN run current (.EXE) file"
$ SAY "SEARCH search current file for string (string on next line)"
$ SAY "SELECT enable the USP facility (default)
$ SAY "SPAWN spawns a subprocess (type RETURN to return to REV)"
$ SAY "STORE writes current filespec into REV.LST in default directory"
$ SAY "TYPE type current file"
$ SAY ""
$ GOTO PROMPT
$
$!**** NOSELECT ****
$X_NOSELECT:
$X_NOSELEC:
$X_NOSELE:
$X_NOSEL:
$ SET NOON
$ SET MESS/F/S/I/T
$ SELECT_DISABLED:=TRUE
$ GOTO PROMPT
$
$!**** PARENT ****
$X_PARENT:
$X_PAREN:
$X_PARE:
$X_PAR:
$X_PA:
$ SET NOON
$ SET MESS/F/S/I/T
$ SET FIL/OWN=PAR 'DEVNAM''DIRNAM''FNAME'
$ GOTO PROMPT
$
$!**** PRINT ****
$X_PRINT:
$X_PRIN:
$X_PRI:
$ SET NOON
$ SET MESS/F/S/I/T
$ PRINT 'DEVNAM''DIRNAM''FNAME'
$ GOTO PROMPT
$
$!**** PROTECT ****
$X_PROTECT:
$X_PROTEC:
$X_PROTE:
$X_PROT:
$X_PRO:
$ SET NOON
$ SET MESS/F/S/I/T
$ SAY "Protection is ''F$FI(FFNAME,"PRO")'"
$ INQU NEW "Enter new protection code"
$ IF NEW .EQS. "" THEN GOTO PROMPT
$ SET PROT=('NEW') 'DEVNAM''DIRNAM''FNAME'
$ GOTO PROMPT
$
$!**** PUSH ****
$X_PUSH:
$X_PUS:
$X_PU:
$ SET ON
$ SET MESS/F/S/I/T
$ ON CONTROL_Y THEN GOTO X_PUSH
$ SAY "%REV-I-PUSHED, Type POP to return to REV"
$
$PUSH_NEXT:
$ ON WARNING THEN GOTO PUSH_NEXT
$ INQ/NOP CMD "$ "
$ IF CMD .EQS. "POP" .OR. CMD .EQS. "PO" THEN GOTO PUSH_POP
$ IF CMD .EQS. "" THEN GOTO PUSH_NEXT
$ 'CMD'
$ GOTO PUSH_NEXT
$
$PUSH_POP:
$ ON CONTROL_Y THEN GOTO CTRLY
$ GOTO PROMPT
$
$!**** Query (?) ****
$X_QUERY:
$ SAY "One of the following:"
$ SAY " @ APPEND BLANK COPY DELETE DIRECTORY DUMP EDIT"
$ SAY " ENTER EXIT FULL HELP NOSELECT PARENT PRINT PROTECT"
$ SAY " PUSH RENAME RUN SEARCH SELECT SPAWN STORE TYPE"
$ SAY "or <CR> for next file"
$ SAY ""
$ GOTO PROMPT
$
$!**** RENAME ****
$X_RENAME:
$X_RENAM:
$X_RENA:
$X_REN:
$X_RE:
$ SET NOON
$ SET MESS/F/S/I/T
$ INQU CMD " RENAME ''DEVNAM'''DIRNAM'''FNAME' to be"
$ RENAME 'DEVNAM''DIRNAM''FNAME' 'CMD'
$ GOTO NEXT
$
$!**** RUN ****
$X_RUN:
$X_RU:
$ SET NOON
$ SET MESS/F/S/I/T
$ CUREXT:='F$PARSE(FNAME,,,"TYPE")
$ IF CUREXT .NES. ".EXE" THEN GOTO NOT_EXE
$ ASS/USE TT SYS$INPUT
$ RUN 'DEVNAM''DIRNAM''FNAME'
$ GOTO PROMPT
$
$NOT_EXE:
$ SAY "%REV-E-NOTEXE, Cannot run a non-EXE file"
$ SAY ""
$ GOTO PROMPT
$
$!**** SEARCH ****
$X_SEARCH:
$X_SEARC:
$X_SEAR:
$X_SEA:
$ SET NOON
$ SET MESS/F/S/I/T
$ INQ NEW " SEARCH ''DEVNAM'''DIRNAM'''FNAME' for"
$ SEARCH 'DEVNAM''DIRNAM''FNAME' "''NEW'"
$ SAY ""
$ GOTO PROMPT
$
$!**** SELECT ****
$X_SELECT:
$X_SELEC:
$X_SELE:
$X_SEL:
$ SET NOON
$ SET MESS/F/S/I/T
$ SELFIL:="not set up"
$ IF SELECT_PROC .NES. "" THEN SELFIL:='SELECT_PROC'
$ SAY "Select file is ''SELFIL' , enter new filespec or RETURN"
$ INQ REP "New USP filespec "
$ IF REP .NES. "" THEN SELECT_PROC:='REP'
$ SELECT_DISABLED:=FALSE
$ GOTO PROMPT
$
$!**** SPAWN ****
$X_SPAWN:
$X_SPAW:
$X_SPA:
$X_SP:
$ SET NOON
$ SET MESS/F/S/I/T
$ RET*URN:=="STOP/ID=0"
$ SPAWN/INPUT=SYS$COMMAND
$ DEL/SYM/G RETURN
$ GOTO PROMPT
$
$X_STORE:
$X_STOR:
$X_STO:
$X_ST:
$ SET NOON
$ SET MESS/F/S/I/T
$ IF F$SEARCH("REV.LST",4) .EQS. "" THEN CREA REV.LST
$ OPEN/APP REVSTORE REV.LST
$ WRITE REVSTORE "''DEVNAM'''DIRNAM'''FNAME'"
$ CLOSE REVSTORE
$ GOTO PROMPT
$
$!**** TYPE ****
$X_TYPE:
$X_TYP:
$X_TY:
$X_T:
$ SET NOON
$ SET MESS/F/S/I/T
$ TYPE 'DEVNAM''DIRNAM''FNAME'
$ SAY ""
$ GOTO PROMPT
$
$!**** Error trap ****
$AMBIG:
$ SET MESS/F/S/I/T
$ SAY "%REV-W-BADCMD, Unrecognised or ambiguous command"
$ SAY ""
$ ON WARNING THEN GOTO AMBIG
$ GOTO PROMPT