Annotation of 43BSDReno/share/doc/usd/12.edtut/e7, revision 1.1.1.1

1.1       root        1: .\"    @(#)e7  6.1 (Berkeley) 5/22/86
                      2: .\"
                      3: .sp 2
                      4: .SH
                      5: Summary of Commands and Line Numbers
                      6: .PP
                      7: The general form of
                      8: .ul
                      9: ed
                     10: commands is the command name,
                     11: perhaps preceded by one or two line numbers, and,
                     12: in the case of
                     13: .UL e ,
                     14: .UL r ,
                     15: and
                     16: .UL w ,
                     17: followed by a file name.
                     18: Only one command is allowed per line,
                     19: but a
                     20: .UL p
                     21: command may follow any other command
                     22: (except for
                     23: .UL e ,
                     24: .UL r ,
                     25: .UL w
                     26: and
                     27: .UL q ).
                     28: .LP
                     29: .UL a :
                     30: Append, that is, 
                     31: add lines to the buffer (at line dot, unless
                     32: a different line is specified). Appending continues until
                     33: \*.
                     34: is typed on a new line.
                     35: Dot is set to the last line appended.
                     36: .LP
                     37: .UL c :
                     38: Change the specified lines to the new text which follows.
                     39: The new lines are terminated by a
                     40: \*.,
                     41: as with
                     42: .UL a .
                     43: If no lines are specified,
                     44: replace line dot.
                     45: Dot is set to last line changed.
                     46: .LP
                     47: .UL d :
                     48: Delete the lines specified.
                     49: If none are specified, delete line dot.
                     50: Dot is set to the first undeleted line,
                     51: unless
                     52: .UL $
                     53: is deleted,
                     54: in which case dot is set to
                     55: .UL $ .
                     56: .LP
                     57: .UL e :
                     58: Edit new file.
                     59: Any previous
                     60: contents of the buffer are thrown away,
                     61: so issue a
                     62: .UL w
                     63: beforehand.
                     64: .LP
                     65: .UL f :
                     66: Print remembered filename.
                     67: If a name follows
                     68: .UL f
                     69: the remembered name will be set to it.
                     70: .LP
                     71: .UL g :
                     72: The command
                     73: .P1
                     74: g/\(hy\(hy\(hy/commands
                     75: .P2
                     76: will execute the commands on those lines that contain
                     77: .UL --- ,
                     78: which can be any context search expression.
                     79: .LP
                     80: .UL i :
                     81: Insert lines before specified line (or dot)
                     82: until a
                     83: \*.
                     84: is typed on a new line.
                     85: Dot is set to last line inserted.
                     86: .LP
                     87: .UL m :
                     88: Move lines specified to after the line
                     89: named after
                     90: .UL m .
                     91: Dot is set to the last line moved.
                     92: .LP
                     93: .UL p :
                     94: Print specified lines.
                     95: If none specified, print
                     96: line dot.
                     97: A single line number is equivalent to
                     98: .IT line-number
                     99: .UL p .
                    100: A single return prints
                    101: .UL .+1 ,
                    102: the next line.
                    103: .LP
                    104: .UL q :
                    105: Quit
                    106: .IT ed .
                    107: Wipes out all text in buffer
                    108: if you give it twice in a row without first giving a
                    109: .UL w
                    110: command.
                    111: .LP
                    112: .UL r :
                    113: Read a file into buffer (at end unless specified
                    114: elsewhere.) Dot set to last line read.
                    115: .LP
                    116: .UL s :
                    117: The command
                    118: .P1
                    119: s/string1/string2/
                    120: .P2
                    121: substitutes the characters
                    122: .UL string1
                    123: into
                    124: .UL string2
                    125: in the specified lines.
                    126: If no lines are specified, make the substitution in line dot.
                    127: Dot is set to last line in which a
                    128: substitution took place, which means that if no substitution took place, dot is not changed.
                    129: .UL s
                    130: changes only the first occurrence of
                    131: .UL  string1 
                    132: on a line;
                    133: to change all of them, type a
                    134: .UL g
                    135: after the final slash.
                    136: .LP
                    137: .UL v :
                    138: The command
                    139: .P1
                    140: v/\(hy\(hy\(hy/commands
                    141: .P2
                    142: executes
                    143: .UL commands
                    144: on those lines that
                    145: .ul
                    146: do not
                    147: contain
                    148: .UL --- .
                    149: .LP
                    150: .UL w :
                    151: Write out buffer onto a file.
                    152: Dot is not changed.
                    153: .LP
                    154: .UL .= :
                    155: Print value of dot.
                    156: .UL = "" (
                    157: by itself prints the value of
                    158: .UL $ .)
                    159: .LP
                    160: .UL ! :
                    161: The line
                    162: .P1
                    163: !command\(hyline
                    164: .P2
                    165: causes
                    166: .UL command-line
                    167: to be executed as a
                    168: .UC UNIX
                    169: command.
                    170: .LP
                    171: .UL /-----/ :
                    172: Context search.
                    173: Search for next line which contains
                    174: this string of characters.
                    175: Print it.
                    176: Dot is set to the line where string
                    177: was found.
                    178: Search starts at
                    179: .UL .+1 ,
                    180: wraps around from
                    181: .UL $
                    182: to
                    183: 1,
                    184: and continues to dot, if necessary.
                    185: .LP
                    186: .UL ?-----? :
                    187: Context search in reverse direction.
                    188: Start search
                    189: at
                    190: .UL .\-1 ,
                    191: scan to 1,
                    192: wrap around to
                    193: .UL $ .

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.