diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-10-06 02:43:37 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-10-06 02:43:37 +0000 |
commit | 37567b7c3cb65f88a9ffbeee7e3ab97241fd2b4c (patch) | |
tree | 070e9d74e17bddb1efdd5e720f3b1cac6d95d91a /bin | |
parent | 991a59d64561c8bb2d13392af86e60e7cfc44773 (diff) |
- Get rid of more short lines.
- Fix a formatting error I missed in the last commit.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ed/ed.1 | 142 |
1 files changed, 50 insertions, 92 deletions
diff --git a/bin/ed/ed.1 b/bin/ed/ed.1 index e9b283c138e..e851cf6d4b5 100644 --- a/bin/ed/ed.1 +++ b/bin/ed/ed.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ed.1,v 1.26 2000/10/06 02:14:13 aaron Exp $ +.\" $OpenBSD: ed.1,v 1.27 2000/10/06 02:43:36 aaron Exp $ .\" .Dd May 2, 1993 .Dt ED 1 @@ -138,12 +138,11 @@ An address represents the number of a line in the buffer. .Nm maintains a .Em current address -which is -typically supplied to commands as the default address when none is specified. +which is typically supplied to commands as the default address +when none is specified. When a file is first read, the current address is set to the last line of the file. -In general, the current address is set to the last line -affected by a command. +In general, the current address is set to the last line affected by a command. .Pp A line address is constructed from one of the bases in the list below, optionally followed @@ -165,18 +164,16 @@ This means .Dq before the first line , and is legal wherever it makes sense. .Pp -An address range is two addresses separated either by a comma or -semi-colon. +An address range is two addresses separated either by a comma or semi-colon. The value of the first address in a range cannot exceed the value of the second. -If only one address is given in a range, then -the second address is set to the given address. +If only one address is given in a range, +then the second address is set to the given address. If an .Em n Ns No -tuple of addresses is given where .Em n > 2 , -then the corresponding range is determined by the last two addresses in -the +then the corresponding range is determined by the last two addresses in the .Em n Ns No -tuple. If only one address is expected, then the last address is used. .Pp @@ -211,8 +208,7 @@ previous line, where .Em n is a non-negative number. .It Em + -The -next line. +The next line. This is equivalent to .Em +1 and may be repeated with cumulative effect. @@ -227,29 +223,25 @@ The first through last lines in the buffer. This is equivalent to the address range .Em 1,$ . .It Em \&; -The -current through last lines in the buffer. +The current through last lines in the buffer. This is equivalent to the address range .Em .,$ . .It Em / Ns No re Ns Em / -The -next line containing the regular expression +The next line containing the regular expression .Em re . The search wraps to the beginning of the buffer and continues down to the current line, if necessary. .Em // repeats the last search. .It Em ? Ns No re Ns Em ? -The -previous line containing the regular expression +The previous line containing the regular expression .Em re . The search wraps to the end of the buffer and continues up to the current line, if necessary. .Em ?? repeats the last search. -.It Em \&\'lc -The -line previously marked by a +.It Em \&\' Ns No lc +The line previously marked by a .Em k (mark) command, where .Em lc @@ -342,9 +334,7 @@ of the form .Em [.col-elm.] No or Em [=col-elm=] where .Em col-elm -is a -collating element -are interpreted according to +is a collating element are interpreted according to .Xr locale 5 (not currently supported). See @@ -354,8 +344,7 @@ for an explanation of these constructs. Matches any single character, other than newline, not in .Em char-class Ns No . .Em char-class -is defined -as above. +is defined as above. .It Em ^ If .Em ^ @@ -365,8 +354,8 @@ Otherwise, it matches itself. .It Em $ If .Em $ -is the last character of a regular expression, it -anchors the regular expression to the end of a line. +is the last character of a regular expression, +it anchors the regular expression to the end of a line. Otherwise, it matches itself. .It Em \e< Anchors the single character regular expression or subexpression @@ -389,30 +378,25 @@ is a number in the range [1,9], expands to the text matched by the subexpression. For example, the regular expression .Em \e(.*\e)\e1 -matches any string -consisting of identical adjacent substrings. -Subexpressions are ordered relative to -their left delimiter. +matches any string consisting of identical adjacent substrings. +Subexpressions are ordered relative to their left delimiter. .It Em * Matches the single character regular expression or subexpression immediately preceding it zero or more times. If .Em * -is the first -character of a regular expression or subexpression, then it matches -itself. +is the first character of a regular expression or subexpression, +then it matches itself. The .Em * operator sometimes yields unexpected results. For example, the regular expression .Em b* -matches the beginning of -the string +matches the beginning of the string .Em abbb (as opposed to the substring .Em bbb Ns No ), -since a null match -is the only leftmost match. +since a null match is the only leftmost match. .Sm off .It Xo Em \e{ No n,m .Em \e}\ \e{ No n, Em \e}\ @@ -470,16 +454,15 @@ Text is entered in input mode. The current address is set to last line entered. .It (.,.) Ns Em c Changes lines in the buffer. -The addressed lines are deleted -from the buffer, and text is appended in their place. +The addressed lines are deleted from the buffer, +and text is appended in their place. Text is entered in input mode. The current address is set to last line entered. .It (.,.) Ns Em d Deletes the addressed lines from the buffer. If there is a line after the deleted range, then the current address is set to this line. -Otherwise the current address is set to the line -before the deleted range. +Otherwise the current address is set to the line before the deleted range. .It Em e No file Edits .Em file Ns No , @@ -487,8 +470,7 @@ and sets the default filename. If .Em file is not specified, then the default filename is used. -Any lines in the buffer are deleted before -the new file is read. +Any lines in the buffer are deleted before the new file is read. The current address is set to the last line read. .It Em e No !command Edits the standard output of @@ -507,8 +489,7 @@ Edits unconditionally. This is similar to the .Em e -command, -except that unwritten changes are discarded without warning. +command, except that unwritten changes are discarded without warning. The current address is set to the last line read. .It Em f No file Sets the default filename to @@ -521,8 +502,7 @@ Applies .Em command-list to each of the addressed lines matching a regular expression .Em re Ns No . -The current address is set to the -line currently matched before +The current address is set to the line currently matched before .Em command-list is executed. At the end of the @@ -549,15 +529,12 @@ command. .It (1,$) Ns Em G Ns No /re/ Interactively edits the addressed lines matching a regular expression .Em re Ns No . -For each matching line, -the line is printed, -the current address is set, +For each matching line, the line is printed, the current address is set, and the user is prompted to enter a .Em command-list Ns No . At the end of the .Em g -command, the current address -is set to the last line affected by (the last) +command, the current address is set to the last line affected by (the last) .Em command-list Ns No . .Pp The format of @@ -574,8 +551,7 @@ Toggles the printing of error explanations. By default, explanations are not printed. It is recommended that .Nm -scripts begin with this command to -aid in debugging. +scripts begin with this command to aid in debugging. .It Em h Prints an explanation of the last error. .It (.) Ns Em i @@ -584,8 +560,7 @@ Text is entered in input mode. The current address is set to the last line entered. .It (.,.+1) Ns Em j Joins the addressed lines. -The addressed lines are -deleted from the buffer and replaced by a single +The addressed lines are deleted from the buffer and replaced by a single line containing their joined text. The current address is set to the resultant line. .It (.) Ns Em klc @@ -604,21 +579,17 @@ when viewing a binary file, for instance), a .Dq --More-- prompt is printed on the last line. .Nm -waits until the RETURN key is pressed -before displaying the next screen. -The current address is set to the last line -printed. +waits until the RETURN key is pressed before displaying the next screen. +The current address is set to the last line printed. .It (.,.) Ns Em m Ns No (.) Moves lines in the buffer. The addressed lines are moved to after the right-hand destination address, which may be the address .Em 0 (zero). -The current address is set to the -last line moved. +The current address is set to the last line moved. .It (.,.) Ns Em n -Prints the addressed lines along with -their line numbers. +Prints the addressed lines along with their line numbers. The current address is set to the last line printed. .It (.,.) Ns Em p Prints the addressed lines. @@ -637,25 +608,21 @@ Quits unconditionally. This is similar to the .Em q -command, -except that unwritten changes are discarded without warning. +command, except that unwritten changes are discarded without warning. .It ($) Ns Em r No file Reads .Em file to after the addressed line. If .Em file -is not specified, then the default -filename is used. +is not specified, then the default filename is used. If there was no default filename prior to the command, then the default filename is set to .Em file Ns No . Otherwise, the default filename is unchanged. The current address is set to the last line read. .It ($) Ns Em r No !command -Reads -to after the addressed line -the standard output of +Reads to after the addressed line the standard output of .Em !command Ns No , (see the .Em ! @@ -755,8 +722,7 @@ Copies (i.e., transfers) the addressed lines to after the right-hand destination address, which may be the address .Em 0 (zero). -The current address is set to the last line -copied. +The current address is set to the last line copied. .It Em u Undoes the last command and restores the current address to what it was before the command. @@ -792,8 +758,7 @@ is lost without warning. If there is no default filename, then the default filename is set to .Em file Ns No , otherwise it is unchanged. -If no filename is specified, then the default -filename is used. +If no filename is specified, then the default filename is used. The current address is unchanged. .It (1,$) Ns Em wq No file Writes the addressed lines to @@ -816,10 +781,8 @@ This is similar to the command, expect that the previous contents of file is not clobbered. The current address is unchanged. .It Em x -Prompts for an encryption key which is used in subsequent reads and -writes. -If a newline alone is entered as the key, then encryption is -turned off. +Prompts for an encryption key which is used in subsequent reads and writes. +If a newline alone is entered as the key, then encryption is turned off. Otherwise, echoing is disabled while a key is read. Encryption/decryption is done using the .Xr bdes 1 @@ -835,8 +798,7 @@ The current address is set to the last line printed. .It ($) Ns Em = Prints the line number of the addressed line. .It (.+1) Ns Em newline -Prints the addressed line, and sets the current address to -that line. +Prints the addressed line, and sets the current address to that line. .It Em ! Ns No command Executes .Em command @@ -894,8 +856,7 @@ processes arguments for backslash escapes, i.e., in a filename, any characters preceded by a backslash .Pq Ql \e -are -interpreted literally. +are interpreted literally. .Pp If a text (non-binary) file is not terminated by a newline character, then @@ -909,10 +870,8 @@ When an error occurs, .Nm prints a .Dq ? -and either returns to command mode -or exits if its input is from a script. -An explanation of the last error can be -printed with the +and either returns to command mode or exits if its input is from a script. +An explanation of the last error can be printed with the .Em h (help) command. .Pp @@ -936,8 +895,7 @@ the command list is executed only once. .Pp If diagnostics are not disabled, attempting to quit .Nm -or edit another file before writing a modified buffer -results in an error. +or edit another file before writing a modified buffer results in an error. If the command is entered a second time, it succeeds, but any changes to the buffer are lost. .Sh HISTORY |