.ad 9 .im qpr6670 typ='11 10 11 193' dup=1 fontchg=yes qua=4 .ll 65;.bm 5 .tt /TED - Line Editing on the VAX 785//Page % / .fo off .bd COMMAND LINE .bd VAX/VMS command line format The editor is entered via the command SED filename or TED filename. The SED command will cause the screen edit mode to be the default edit mode, whereas the TED command will enter line edit mode. The filename is optional, if present that file will be loaded if it exists; otherwise the file will be created. Note that the file is not actually created until you END the editor. If you omit 'filename' the editor will edit the file you last edited, using your current directory as the default. If you have just logged in there will be no 'last file edited' so TED would then prompt for a file to edit. There are several switches that can be placed on the command line after the filename that may be useful. They are /CREATE for create, /CASE to force lower to upper case, /TAB to force expansion of horizontal tabs to spaces and /XL to force both tab expansion and case conversion. Keep in mind that TED always loads its own copy of the file being edited. It is not updated to your directory until you END or use the SAVE command. Examples: $ TED JUNK.DAT/TAB $ TED JUNK.DAT/CR Additionally, if your home directory (SYS$LOGIN:) has a file of the name TEDINIT.INI, TED (or SED) will read commands from that file to set your environment up. See HELP SET for information. .bd Line editor command line format Command line format once in the editor is always of the form: EDIT> COMMAND low_limit,high_limit:target_line/file_name The defaults are always: low_limit = first line of the file (line one) high_limit = last line of the file (line * ) target = first line of the file (line one) file_name = terminal There are a few exceptions to this format for consistency with DCL command formats, they are: DCL dcl_command_line or DCL/command_line HELP topic_name or HELP/topic_name SET class value or SET/class value SPAWN dcl_command_line or SPAWN/command_line TYPE file_name or TYPE/file_name See the section for individual commands for further information. .sp .bd WILDCARD The VMS version of TED allows the use of fully wildcarded filenames as the input file. If TED (or SED) encounters a wildcarded name it will proceed to search for matching files and prompt you to decide which one(s) to edit. The responses recognized are (only the first character is needed): YES to edit the file NO to skip it QUIT to exit TED BACKUP to go back to the previous file TOP to start over with the first file .sp SWITCH to read a new file specification Carriage return to skip the file Control C to exit TED Example: $ SED 1:[.ted]*.c Edit file 1:[BRIAN.TED]EDINS.C;11 ? Y .bd $ Command: $ [vmscommandline] The $ command, like the DCL and SPAWN commands, will take a command line argument and call the system command line interpreter. In the case of VMS, this is, of course, DCL. This command allows you to give commands to the system without ever leaving the editor. There are two forms of this editor command, in that leaving off the DCL command text will cause the editor to wait until the subprocess exits. This is done under VMS with the LOGOUT command. Example: EDIT> $ SHO SYSTEM EDIT> $ .bd ADD Command: ADD [/file_name] The ADD command takes input from either the current terminal or a disk file and appends the text to the end of the file currently being edited. Example: EDIT> ADD EDIT> ADD/junkfiles:junk.dat .cp .bd APPEND Command: APPEND [low_limit[,high_limit]] [/file_name] Abbreviation: APP The APPEND command adds text at the end of a line or group of lines, one at a time. If input is directed from a disk file, the result is to add the text from corresponding lines to the end of each line. Example: EDIT> TYPE JUNK.DAT first line from junk.dat second line from junk.dat EDIT> L5,6 5 )this is line 5 6 )this is line 6 EDIT> APP 5,6/JUNK.DAT EDIT> L5,6 5 )this is line 5first line from junk.dat 6 )this is line 6second line from junk.dat Of course, if the FILE argument is omitted, you will be prompted for input for each line from your terminal. .bd ASCII Command: ASCII [low_limit[,high_limit] Abbreviation: AS The ASCII command dumps the specified line range to the terminal in a formatted display. The decimal ASCII equivalents are printed on the left hand side of the display, with the printable ASCII text along side it on the right hand side of the display. Note that the entire file is dumped if no line number range is given. .bd CASE Command: CASE The CASE command causes the lower to upper case translation flag to toggle. If set, all subsequent text input is converted to upper case where applicable. This command is provided for compatibility with the PDP-11 version of TED. The SET CASE command offers more flexibility. For further information, see help for SET and help for COMMANDLINE. .cp .bd CDELETE Command: CDELETE [low_limit[,high_limit]] Abbreviation: CD The CDELETE (CharacterDELETE) allows you to delete characters within a line(s) based on position within the line. This is useful for converting file formats such as directory listings to command files where the source file follows a well defined format. Example: .sp EDIT> L2,3 2 )A single user VAX 11/785 is nice 3 )1234567890ABCDEFGHIJKLMNOPQR EDIT> CD2,3 Delete> xxxxxxx 2 )A single user VAX is nice 3 )1234567890ABCDEFGHPQR EDIT> The reprinting of the altered lines can be suppressed by the command QUIET or SET QUIET. .bd CHANGE Command: CHANGE [low_limit[,high_limit][/file_name] Abbreviation: C The CHANGE command allows the user to delete one or more lines and replace them with new line(s) from the specified file. If no file_name is given, input is assumed to come from the terminal. The CHANGE command is actually a combined DELETE and INSERT command. If just LOW_LIMIT is given, that line will be deleted and new lines will be inserted from the specified file or terminal. If a range of lines is given, as in CHANGE 20,30 , all lines from the low_limit up to and including the high_limit will be deleted, with new lines being taken from the file (if given) or the terminal. Examples: EDIT>C20,30/fubar.txt EDIT>C200,300 EDIT>C1 The first example deletes lines 20 to 30 and then inserts text from the disk file FUBAR.TXT. The second example deletes 101 lines from line 200 up to and including line 300, and then prompts for new text from the terminal. The third example deletes the first line of the file and replaces it with text from the terminal. .cp .bd COPY Command: COPY [low_limit[,high_limit]][target_line] The COPY command will take the specified lines and duplicate them at the target line. As always, the default for LOW_LIMIT is line 1, for the HIGH_LIMIT it is the last line, and for the TARGET_LINE it is line 1. Thus, the COPY command without any arguments would duplicate the entire file. A companion command to COPY is MOVE, which is like a combined COPY and DELETE. Example: EDIT> COPY1,10:100 .sp .bd DCL Command: DCL [vmscommandline] The DCL command is identical to the $ command, it takes the command after 'DCL' and spawns (on VMS) the command. If the COMMANDLINE argument is omitted, it spawns DCL and waits for the subprocess to exit via the LOGOUT DCL command. The screen editor (accessed via the VT command within TED, or the SED command from DCL) has two versions of this available, one which will record the output from the subprocess and insert it into the file being edited. Example: EDIT> DCL SHO DEV D List of Devices on 4-JAN-1985 10:15:23.61 Device Device Device Err. Volume Free Trans Mount Name Status Characteristics Count Label Blocks Count Count DUA0: on line mnt 0 VAXVMSRL3 725356 46 1 DUA1: on line mnt 0 USERDISK1 333632 4 1 .bd DELETE Command: DELETE [low_limit[,high_limit]][/file_name] Abbreviation: D The DELETE command allows you to delete a line or group of lines, optionally writing those lines to a disk file before they are removed from your file being edited. If you should happen to accidently delete a line, the UNDELETE command can be used to recover it, as in UNDEL 100. Note that DELETE only saves the last line deleted, so that the command DEL1,10 would only leave line 10 available for UNDELETE. In the following examples, the first deletes lines 20 though and including line 30. The second example removes lines 100 and 101, saving them into the disk file called JUNK. The third example deletes line 20 and then undeletes it. Examples: EDIT> D20,30 EDIT> D100,101/JUNK EDIT> DEL 20 EDIT> UNDEL 20 .sp .bd DIR .sp Command: DIRECTORY Abbreviation: DIR .sp Provides a list of files or information about a file or group of files. Spawns the DCL DIRECTORY command. .sp .bd DUMP Command: DUMP The DUMP command simply dumps some internal data structures to the terminal. .sp .bd DUPLICATE Command: DUPLICATE [low_limit[,high_limit]] Abbreviation: DUP The DUPLICATE command simply takes a line and appends that line to itself. As in other commands, specifying the lowlimit only will only duplicate that line, whereas giving a low and high limit will do the same for each line in that range. The command given without any line ranges will do the entire file. Example: EDIT> DUP1,3 Before: line 1 > 1:[.junk]junk.dat line 2 > 1:[.fubar]field.circus;1 line 3 > 1:[.fubar]zz.zz After: line 1 > 1:[.junk]junk.dat1:[.junk]junk.dat line 2 > 1:[.fubar]field.circus;11:[.fubar]field.circus;1 line 3 > 1:[.fubar]zz.zz1:[.fubar]zz.zz .bd;END Command: END Abbreviation: E The END command terminates the current edit and writes the file back to disk. The END command prompts for an output filename, with the filename displayed within <> being the default to use if your response to the command is a carriage return. Example: .sp EDIT> E Output file ? $ EDIT> E Output file ? JUNK.DAT $ .bd EXIT Command: EXIT The EXIT command is identical to the END command. See HELP END. .bd FILE Command: FILE Abbreviation: F The FILE command tells you the name of file you are editing. .sp .bd INSERT Command: INSERT [at_line_number][/file_name] Abbreviation: I The INSERT command takes lines of text from either the terminal or a disk file and places these lines into the file being edited (please keep in mind that the input file is never altered until you END the editor). The optional line number specifies where in the file the input will be placed. If omitted all text will be placed at the start of your file, in other words, at line one. The first example will take the disk file FUBAR.TXT and insert it in front of line 100 in your file. The second example is the default case, it reads lines from the terminal and inserts them at the top of the file, with input terminated with a CONTROL/Z. Example: EDIT> I100/FUBAR.TXT EDIT> I .bd HELP Help is available on the following topics: $ ADD APPEND ASCII CASE CDELETE CHANGE COMMAND_LINE COPY DCL DELETE DUMP DUPLICATE END EXIT FILE INSERT LEN LIST MOVE PLACE QUIET QUIT REPLACE RETICENT SAVE SEARCH SET SPAWN STATS TAB TAPPEND TIME TRIM TYPE UNDELETE VERBOSE VTEDIT WILDCARD_FILENAMES XCHANGE XLATE /L The following system commands are also in TED: DIRECTORY ERASE (Delete/erase) PURGE ZAP Optional arguments are normally indicated by surrounding the text with [] , as in ADD [/file_name] which means that the file_name is optional. .sp .bd LEN Command: LEN Syntax: LEN [low_limit[,high_limit]] The LEN command prints out the length of the specified lines along with a symbolic representation of the terminators for the line(s). .sp .bd LIST Command: LIST Syntax: LIST [low_limit[,high_limit]][/file_name] Abbreviation: L The LIST command writes your text either to the terminal or to a disk file. The default is, of course, the terminal. A file with the text in it can be created by supplying a file_name, as in LIST 1,10/FUBAR.DAT. The defaults for the line number range are one (1) for the low_limit and * (the last line) for the high_limit. Examples: EDIT> L1,10/T.T Copies lines 1 through 10 into the disk file T.T EDIT> L1,10 Prints lines 1 through 10 on the terminal. EDIT> L Prints the entire file on the terminal. .bd MOVE Command: MOVE Syntax: MOVE low_limit[,high_limit]:destination_line Abbreviation: M The MOVE command allows the movement of blocks of text from one part of the file to another. The effect is a COPY operation followed by a DELETE. The third argument, the destination, is the line number in the file for the desired lines to be placed at. For instance, M1,10:100 takes lines one through ten and places them at line 100, leaving what used to be line 11 as line 1 now, while the command M100,110:1 would takes lines 100 through 110 and put them at the start of the file. Example: EDIT> MOVE1,10:100 Moves lines 1 through 10 to line 100. .sp .bd PLACE Command: PLACE Syntax: PLACE [low_limit[,high_limit]] Abbreviation: P The PLACE command allows you to insert a character string anywhere in a line or blocks of lines based on position within the line(s). It is very useful for generating things like command files from directory listings. When this command is executed, TED will prompt with a Insert> prompt. At that point, you simply space or tab over to the position in the line(s) where the text is to be inserted. If leading spaces or tabs are .ud set | .bi |to be inserted, type a |/| (tilde) to delimit it. In this example, the LIST command is done to show the lines before the PLACE command is used. The PLACE command, by default, always echoes the lines it modifies to the terminal. This can be avoided with the QUIET or SET QUIET commands. Example: EDIT> L1,3 1)1:[.fubr]testprog.for 2)1:[.fubr]testprog.com 3)1:[.fubr]testprog.exe EDIT> P1,3 Insert> =msa0: 1)1:[.fubr]=msa0:testprog.for 2)1:[.fubr]=msa0:testprog.com 3)1:[.fubr]=msa0:testprog.exe EDIT> .bd PURGE .sp Command: PURGE .sp Deletes all but the highest numbered version(s) of the file(s). Spawns the DCL PURGE command. .sp .bd QUIET Command: QUIET The QUIET command suppress the automatic printing of modified lines by commands such as REPLACE, PLACE, TAPPEND and others. It is the same as the SET QUIET command. .bd QUIT Command: QUIT The QUIT command aborts the current edit without updating the file being edited on disk. If there are more than 15 lines in the file, you will be asked to confirm the command. The QQUIT command can be used to avoid the confirmation. .sp .bd REPLACE Command: REPLACE Syntax: REPLACE [low_limit[,high_limit]] Abbreviation: R The REPLACE command substitutes any text matching a search pattern with a replacement text string. The REPLACE command will prompt for the pattern text and the replacement text. Sensitivity to case is controlled by the SET SEARCH EXACT and SET SEARCH GENERAL commands. The following example takes ALL occurrences of the string December and replaces that text with the text January. Example: EDIT> R1,3 Search text ? December Replacement text ? January EDIT> .bd SAVE Command: SAVE The SAVE command writes the current contents of your file back out to disk under the same filename. .sp .bd SEARCH Command: SEARCH Syntax: SEARCH [low_limit[,high_limit]] [:pattern][/file] Abbreviation: S The SEARCH command will print to the terminal or to a disk file any lines within the range if those lines match a user specified search pattern. The pattern can optionally be taken from the file itself by specifying :pattern. As in the REPLACE command, case sensitivity is determined by the SET SEARCH EXACT and SET SEARCH GENERAL commands. In the following examples, the first simply accepts a pattern from the terminal and will print the lines containing that pattern on the terminal. The second will do the same thing but with all output going out to disk, whereas the third example takes the contents of line 1 and looks for that text in the rest of the file. Examples: EDIT> S1,100 Search string ? VAX EDIT> S1,100/PDP.TXT Search string ? PDP EDIT> S:1 .sp .bd SET Command: SET Syntax: SET Keyword [value] The SET command is used to control various options within the editor. This command can also be called from the screen editor (the V command) via Control/V, as some of the settable functions are only relevant to the screen editor. The SET options listed that are prefixed with a * are only applicable to full screen editing. Note that these are commands that you may want to insert in the file TEDINIT.INI . *SET 80 Sets 80 column mode (assume AVO) *SET 132 Sets 132 column mode *SET AST ANY Any command typed while a new screen is being put up cancels the screen display. *SET AST PAGE Only the PF2 key can interrupt SET CASE MIX Leaves case unchanged SET CASE UPPPER Forces lower case input to upper *SET ESCAPE ON Flags special printing for all escape characters (screen edit) *SET ESCAPE OFF Disables special escape print *SET FILL value Sets width for screen editor's Paragraph (gold P) command. SET QUIET Disables automatic echo printing SET SEARCH GENERAL Letters match regardless of case SET SEARCH EXACT Letters must be of same case SET TAB EXPANDED Causes horizontal tabs to be expanded to spaces. SET TAB KEEP Keeps horizontal tabs. *SET TERMINAL value Value is VT100, VT220 or ANSI SET VERBOSE Enables automatic echo printing *SET WORD 'delim' 'delim' Allows the user to specify their own delimiters for the next word command, as in SET WORD ';' .bd SPAWN Command: SPAWN Syntax: SPAWN vmscommandline The SPAWN command is identical to the DCL and $ commands. It simply takes the passed command line and passes it to VMS for execution. .bd STATS Command: STATS The STATS command displays information regarding the performance of TED's internal cacheing algorithms. .bd TAB Command: TAB This command is similar to the SET TAB EXPANDED command in that it causes horizontal tabs to be expanded to spaces. This is useful if the file is to be sent to a non-DEC host that does not understand tabs. .sp .bd TAPPEND Command: TAPPEND Syntax: TAPPEND [low_limit[,high_limit]] Abbreviation: TAP The TAPPEND command will prompt for a specified line of text and then proceed to append it to all the lines specified in the line number range. If no linenumber range is given, the command will be applied to the entire file. The TAPPEND command is thus very similar to the APPEND command, but uses one string for the line range rather than a separate string to append to each line. Example: EDIT>TAP 1,10 Text to append ? EDIT> .bd TIME Command: TIME Abbreviation: T This just prints the date and time of day. .bd TRIM Command: TRIM Syntax: TRIM [low_limit[,high_limit]]:length The TRIM command is used to truncate lines of text. It additionally removes all trailing TABS and SPACES. This is most useful in creating command files from directories and for removing sequence information from Fortran source files. TRIM always echoes each line it alters, thus use the SET QUIET .cp command to disable this if desired. The following example will truncate each line at character position 72 and then remove all trailing spaces and horizontal tabs. Example: EDIT> SET QUIET EDIT> TRIM:72 EDIT> SET VERBOSE .bd TYPE Command: TYPE Syntax: TYPE filename.filetype TYPE/filename.filetype The TYPE command simply prints a file to the terminal. .bd UNDELETE Command: UNDELETE Syntax: UNDELETE [at_linenumber] Abbreviation: UND The UNDELETE command will put back the most recently deleted line at the place in the file specified by the linenumber. If linenumber is unspecified, the deleted line will be place at line one, the first line of the file you are editing. In the following example, line one is accidently deleted and then undeleted to get it back. Note that if you delete a block of lines, as in D1,10 , the only line available to UNDELETE will be line ten. Example: EDIT> D1 EDIT> UN1 .bd VERBOSE Command: VERBOSE The VERBOSE command is the same as SET VERBOSE. It will cause commands such as REPLACE and PLACE to resume printing the results of what they did to the file being edited. .sp Example: EDIT> VERBOSE .cp .bd VTEDIT Command: VTEDIT Abbreviation: V The VTEDIT command calls the screen editor. .bd XCHANGE Command: XCHANGE Syntax: XCHANGE [low_limit[,high_limit]] Abbreviation: X The XCHANGE command is like the PLACE command except that it replaces the text with the new text. The replacement is made by position within the line(s) specified. Example: EDIT> L1,2 1 )12345abcdef 2 )xxxxxxxxxxx EDIT> X1,2 1 )12345abcdef Replace>$$$ 1 )$$$45abcdef 2 )$$$xxxxxxxx EDIT> .bd XLATE Command: XLATE The XLATE command is the same as SET TAB EXPANDED and SET CASE UPPER, except that it is toggled. When ON, tabs that are on any further lines to be inserted are expanded to spaces, and lower case letters are converted to upper case. Note that this applies only to the INSERT and ADD commands. To completely convert a file to upper case without tabs, include on the VMS command line the /XL switch, as in TED IBM.DAT/XL. .cp;.tt ////