NosEdit

CDC NOS EDIT Cheat Sheet

EDIT is a text editor component of Network Operating System (NOS) for the CDC 6000 and Cyber series of supercomputers.

Contents

  1. Concepts
  2. Invocation
  3. Command Syntax
  4. Commands
    1. Add text (multiple lines) (ADD, ADDS)
    2. Add text (single line) (INSERTS)
    3. List text (LIST, LISTS)
    4. Find text (FIND, FINDS)
    5. Move search pointer (SET, RESET)
    6. Change text (multiple lines) (CHANGE, CHANGES)
    7. Change text (single line) (RS)
    8. Delete text (DELETE, DELETES)
    9. String buffer operations (EXTRACT, ES, CLEAR)
    10. Merge files (MERGE)
    11. Leave EDIT (END)
  5. Reference

1. Concepts

Command modeEDIT commands that change or display file contents have two operation modes, line mode and string mode.
Line mode commands change or display one or more complete file lines.
String mode commands change or display only a specified text string within the file, which may a substring of a single line or span multiple lines.
Saving filesEDIT only affects the contents of the user's primary file or other local file. To save the editing results to a permanent file, leave the editor and use the SAVE or REPLACE IAF command.
Search pointerThe search pointer is the file line that EDIT stores as the current line relative to which all change, display, seach, etc. operations are performed. Search pointer is initialized to the first line of the file when EDIT is invoked.
Search stringsA search string has the format /s/ where / represents a delimiter character of the user's choice, except that the delimiter may not be $, space, or another character appearing within the string, and s represents the search target string.
Search typesEDIT commands support two types of searches:
Single-phrase search (syntax: ;/s1/) searches the file for a text string identical to s1.
Ellipsis search (syntax: ;/s1/,/s2/) searches the file for a text string that begins with s1 and ends with s2. Any number of characters may appear between the two matched portions, and may span multiple file lines. An ellipsis search is similar to a wildcard search in other systems. (Commands INSERTS and RS support a special form of search string which has the same form as an ellipsis search string, but do not perform and ellipsis search.)
String bufferThe string buffer is a temporary storage area for file text that is to be copied to other locations in the file. It is similar to the clipboard in other systems.

Syntax notation

The syntax descriptions in this document use the following notation.

Xa literal element and should be typed as-is.
xa variable that should be replaced by a relevant value.
[x]an optional element.
x …a repeatable element.
x|ya choice of elements.

2. Invocation

EDIT[,edit-file[,N|AS[,command-file[,output-file]]]]

edit-filedefaults to the primary file.
Nindicates the normal character set (upper-case alphabetics only).
ASindicates the ASCII 128-character set (upper- and lower-case alphabetics).
command-filedefaults to the terminal.
output-filedefaults to the terminal.

3. Command Syntax

c[:/s1/[,/s2/]][;n]

cis an edit command word or short form.
s1, s2are search strings.
nis an integer indicating a number of lines or a number of search matches, or * to indicate all lines or matches.

4. Commands

4.1. Add text (multiple lines)

Command/
Short form
UsageDescription
Line
mode
ADD
A
AAdd text after search pointer.
A:/s/… after first line after search pointer containing string s.
A;n… after nth line after search pointer.
A:/s/;n… after each of the next n lines after search pointer containing string s.
String
mode
ADDS
AS
AS:/s/[;n]… in line immediately after the next n (default is 1; * for all) occurrences of string s.

After entering an ADD or ADDS command, EDIT prompts with ENTER TEXT. The user may choose one of three actions:

  1. Enter text, including line breaks if desired, to be added to the file, starting and ending with a delimiter character of the user's choice, except that the delimiter may not be $ or a space. The delimiter may appear within the input text as long as it is not the last character before a line break. If a blank line is to be inserted in the file, enter at least one space on the line before the line break.
  2. Enter a single $ by itself to insert the current contents of the string buffer. See EXTRACT and ES commands.
  3. Press Enter by itself to insert a copy of the text entered for the previous ADD/S or CHANGE/S command.|

4.2. Add text (single line)

String
mode
INSERTS
IS
IS:/s1/,/s2/[;n]Insert string s2 immediately after the next n (default is 1; * for all) occurrences of string s1 after search pointer.

4.3. List text

Line
mode
LIST
L
L[;n]List search pointer line and next n following lines (default is 1; * for all)
L:/s1/[,/s2/][;n]List next n (default is 1; * for all) lines after search pointer containing string s1, or next n groups of lines matching ellipsis search s1-s2.
String
mode
LISTS
LS
LS[:/s1/[,/s2/]List next n (default is 1; * for all) matches of string s1 or ellipsis search s1-s2.

4.4. Find text

Line
Mode
FIND
F
F[;n]Advance search pointer n (default is 1; * for all) lines and list the new search pointer line.
F:/s1/[,/s2/][;n]Advance search pointer to line with nth (default is 1; * for all) occurrence of string s1 and list that line, or the first line of the nth group of lines matching ellipsis search s1-s2 and list that group of lines.
String
mode
FINDS
FS
FS:/s1/[,/s2/}][;n]Advance search pointer to line with nth (default is 1; * for all) occurrence of string s1, or the first line of the nth group of lines matching ellipsis search s1-s2 and list the matching string.

4.5. Move search pointer

SET
S
S[;[-]n]Advance (or move back) search pointer n (default is 1; * for the last line in the file) lines from its current position.
S:/s/[;n]Advance search pointer to line after its current position containing the nth (default is 1; * for all) occurrence of string s.
RESET
R
RReturn search pointer to the beginning of the file.

4.6. Change text (multiple lines)

Line
mode
CHANGE
C
C[;n]Replace n (default is 1; * for all) lines starting with search pointer.
C:/s1/[,/s2/][;n]… the next n (default is 1; * for all) lines containing string s1 or groups of lines matching ellipsis search s1-s2 after search pointer.
String
mode
CHANGES
CS
CS:/s1/[,/s2/][;n]… the next n (default is 1; * for all) occurrences of string s1 or ellipsis string s1-s2 in or after search pointer.

After entering a CHANGE or CHANGES command, EDIT prompts with ENTER TEXT. The user may choose one of three actions:

  1. Enter text, including line breaks if desired, to be added to the file, starting and ending with a delimiter character of the user's choice, except that the delimiter may not be $ or a space. The delimiter may appear within the input text as long as it is not the last character before a line break. If a blank line is to be inserted in the file, enter at least one space on the line before the line break.
  2. Enter a single $ by itself to insert the current contents of the string buffer. See EXTRACT and ES commands.
  3. Press Enter by itself to insert a copy of the text entered for the previous ADD/S or CHANGE/S command.|

4.7. Change text (single line)

String
mode
RSRS:/s1/,/s2/[;n]Replace the next n (default is 1; * for all) occurrences of string s1 in or after search pointer line with string s2.

4.8. Delete text (DELETE, DELETES)

Line
mode
DELETE
D
D[;n]Delete n (default is 1; * for all) lines starting with search pointer.
D:/s1/[,/s2/][;n]… the next n (default is 1; * for all) lines containing string s1 or groups of lines matching ellipsis search s1-s2 after search pointer.
String
mode
DELETES
DS
DS:/s1/[,/s2/][;n]… the next n (default is 1; * for all) occurrences of string s1 or ellipsis string s1-s2 in or after search pointer.

4.9. String buffer operations (EXTRACT, ES, CLEAR)

Line
mode
EXTRACT
E
E[;n]Copy and append to string buffer n (default is 1; * for all) lines from file starting with search pointer.
E:/s1/[,/s2/][;n]… the nth (default is 1) line after search pointer containing string s1 or group of lines matching ellipsis search s1-s2.
String
mode
ESES:/s1/[,/s2/][;n]… the nth (default is 1) occurrence of string s1 or ellipsis string s1-s2 in or after search pointer.
CLEAR
CL
CLClear string buffer contents.

4.10. Merge files (MERGE)

MERGE
M
M:/f/[;n]Insert contents of file f into edit file beginning at nth (default is 1) line after search pointer.
M:/f/[,/s/][;n]Insert contents of file f into edit file after the nth (default is 1) line after search pointer containing string s.

4.11. Leave EDIT (END)

ENDENDExit EDIT program and return control to previous subsystem.

NOTE: EDIT only affects the contents of the user's primary file or other local file. To save the editing results to a permanent file, use the SAVE or REPLACE command after leaving the editor.

5. Reference

NOS Version 1 Text Editor Reference Manual (PDF)