1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
|
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "EDLIN 1"
.TH EDLIN 1 2025-02-20 "" ""
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
edlin \- FreeDOS line\-oriented text editor
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBedlin\fR [\fIfilename\fR]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
The FreeDOS \fBedlin\fR program is a small line-oriented text editor. Unline
screen-based editors, \fBedlin\fR does not display the text being edited
at all times, instead only showing parts of it upon the user's request.
.PP
When invoked, \fBedlin\fR presents the user a command line allowing them
to manipulate the text by applying operations on the specified lines of
the text file. All commands operate on whole lines or ranges of lines.
.PP
In general, the structure of an \fBedlin\fR command is as follows:
.Sp
.RS 4
[\fILINE\fR[,\fILINE...\fR]]\fICOMMAND\fR[\fIPARAMETERS...\fR]
.RE
.PP
A line number can be one of the following:
.IP "A sequence of digits as a literal line number, such as \fB12\fR for line 12." 4
.IX Item "A sequence of digits as a literal line number, such as 12 for line 12."
.PD 0
.IP "A full stop (\fB.\fR), meaning the current line in the file." 4
.IX Item "A full stop (.), meaning the current line in the file."
.IP "A dollar sign (\fB$\fR), meaning the last line in the file." 4
.IX Item "A dollar sign ($), meaning the last line in the file."
.IP "A hash sign (\fB#\fR), meaning the line number just after the last line in the file." 4
.IX Item "A hash sign (#), meaning the line number just after the last line in the file."
.IP "A number added or subtracted from a line number (\fB+\fR\f(BIn\fR or \fB\-\fR\f(BIn\fR\fB\fR). This is useful for relative line addressing, such as \fB.+1\fR for the line after the current line." 4
.IX Item "A number added or subtracted from a line number (+n or -n). This is useful for relative line addressing, such as .+1 for the line after the current line."
.PD
.PP
String parameters may be enclosed in either single or double quotes,
and may contain the following escape sequences:
.IP "\fB\ea\fR: Alert character" 4
.IX Item "a: Alert character"
.PD 0
.IP "\fB\eb\fR: Backspace character" 4
.IX Item "b: Backspace character"
.IP "\fB\ee\fR: Escape" 4
.IX Item "e: Escape"
.IP "\fB\ef\fR: Form feed" 4
.IX Item "f: Form feed"
.IP "\fB\et\fR: Horizontal tab" 4
.IX Item "t: Horizontal tab"
.IP "\fB\ev\fR: Vertical tab" 4
.IX Item "v: Vertical tab"
.IP "\fB""\fR: Double quote" 4
.IX Item """: Double quote"
.IP "\fB'\fR: Single quote" 4
.IX Item "': Single quote"
.IP "\fB.\fR: Full stop" 4
.IX Item ".: Full stop"
.IP "\fB\e\fR: Backslash" 4
.IX Item ": Backslash"
.IP "\fB\ex\fR\fIXX\fR: Hexadecimal value, where each \fBX\fR is a hexadecimal digit (\fB0\fR to \fBF\fR, uppercase or lowercase)" 4
.IX Item "xXX: Hexadecimal value, where each X is a hexadecimal digit (0 to F, uppercase or lowercase)"
.IP "\fB\ed\fR\fINNN\fR: Decimal value, where each \fBN\fR is a decimal digit (\fB0\fR to \fB9\fR)" 4
.IX Item "dNNN: Decimal value, where each N is a decimal digit (0 to 9)"
.IP "\fB\eO\fR\fIOO\fR: Octal value, where each \fBO\fR is an octal digit (\fB0\fR to \fB7\fR)" 4
.IX Item "OOO: Octal value, where each O is an octal digit (0 to 7)"
.IP "\fB\e^\fR\fIC\fR: Control character, such as \fB\e^J\fR for the literal ""control J"" (linefeed) character." 4
.IX Item "^C: Control character, such as ^J for the literal ""control J"" (linefeed) character."
.PD
.SH "COMMAND SYNOPSIS"
.IX Header "COMMAND SYNOPSIS"
The edlin program supports the following editor commands:
.IP "\fB#\fR: Edit a single line" 4
.IX Item "#: Edit a single line"
The edlin program outputs the single line indicated by the number, and
the next inputted line replaces the outputted line in the file.
.IP "\fBa\fR: Append to the file" 4
.IX Item "a: Append to the file"
This command is equivalent to \fB$+1i\fR
.IP "[\fILINE\fR]\fB,\fR[\fILINE\fR]\fB,\fR\fILINE\fR\fB,\fR[\fINUMBER\fR]\fBc\fR: Copy a range of lines" 4
.IX Item "[LINE],[LINE],LINE,[NUMBER]c: Copy a range of lines"
Copy a range of consecutive lines to another location in the buffer. The
parameters are, in order:
.RS 4
.IP "1. The first line you want to copy (default is the current line)" 4
.IX Item "1. The first line you want to copy (default is the current line)"
.PD 0
.IP "2. The last line you want to copy (default is the current line)" 4
.IX Item "2. The last line you want to copy (default is the current line)"
.IP "3. The line before which you want to \fIinsert\fR the block of lines" 4
.IX Item "3. The line before which you want to insert the block of lines"
.IP "4. The number of times you want to copy the block (default is 1)" 4
.IX Item "4. The number of times you want to copy the block (default is 1)"
.RE
.RS 4
.PD
.Sp
After copying lines, use the \fBl\fR (list) command to see the new line
numbers.
.RE
.IP "[\fILINE\fR][\fB,\fR\fILINE\fR]\fBd\fR: Delete a range of lines" 4
.IX Item "[LINE][,LINE]d: Delete a range of lines"
Delete a block of consecutive lines from the buffer. The parameters are
the first and last line of the block to be deleted.
.Sp
If you omit the first parameter, delete the block from the current line
\&\fIto the line specified in the second parameter\fR (be sure to include the
comma).
.Sp
If you omit the second parameter, delete \fIonly\fR the line specified in
the first parameter.
.Sp
Omitting both parameters deletes the current line.
.IP "\fBe \fR\fIfilename\fR: Save and exit" 4
.IX Item "e filename: Save and exit"
This command is equivalent to \fBw \fR\fIfilename\fR followed by \fBq\fR
.Sp
This verifies whether the user actually wants to quit before doing so.
To quit, answer the "Abort edit (Y/N)?" prompt with "yes."
.IP "[\fILINE\fR]\fBi\fR: Insert lines" 4
.IX Item "[LINE]i: Insert lines"
Enter insert mode. Its parameter is the line number \fIbefore\fR which you
want to insert lines.
.Sp
While entering text, you can use the escape sequences from above.
.Sp
To exit insert mode, type \fB.\fR (full stop) on a line by itself. (If you
need a line with just a period, you need to enter it as \fB\e.\fR)
.Sp
After exiting insert mode, the line \fIafter\fR the inserted text becomes the
current line, unless the insertion was appended to the end of the buffer,
in which case the last line in the buffer becomes the new current line.
.IP "[\fILINE\fR][\fB,\fR\fILINE\fR]\fBl\fR: List lines" 4
.IX Item "[LINE][,LINE]l: List lines"
List the lines of text to the screen. If you omit the first parameter,
start showing text starting at 11 lines before the current line.
.Sp
If you omit the second parameter, shows a screen of text beginning with
the line specified in the first parameter.
.Sp
If you omit both parameters, show a screen of text starting at 11 lines
before the current line.
.Sp
If the number of lines to show is longer than the number of lines on the
screen, edlin will prompt after each screen.
.IP "[\fILINE\fR]\fB,\fR[\fILINE\fR]\fB,\fR\fILINE\fR\fBm\fR: Move lines" 4
.IX Item "[LINE],[LINE],LINEm: Move lines"
Move a block of text to the line before the number specified in the
third parameter. It is similar to copying then deleting the original
block.
.IP "[\fILINE\fR][\fB,\fR\fILINE\fR]\fBp\fR: Print lines" 4
.IX Item "[LINE][,LINE]p: Print lines"
Similar to the \fBl\fR (list) command except that the default parameters
starts at the current line instead of 11 lines before it.
.IP "\fBq\fR: Quit" 4
.IX Item "q: Quit"
Quit the program.
.Sp
This verifies whether the user actually wants to quit before doing so.
To quit, answer the \e"Abort edit (Y/N)?\e" prompt with \e"yes.\e"
.IP "[\fILINE\fR][\fB,\fR\fILINE\fR][\fB?\fR]\fBr\fR\fISTRING\fR\fB,\fR\fIREPLACEMENT\fR: Replace string" 4
.IX Item "[LINE][,LINE][?]rSTRING,REPLACEMENT: Replace string"
Replace all occurrences of the first string with the second between the
two lines specified.
.Sp
If you omit the first parameter, start replacing at the line \fIafter\fR the
current line.
.Sp
If you omit the second parameter, stops replacing text at the last line
of the buffer.
.Sp
If you include the \fB?\fR (question mark), edlin will print a confirmation
message before replacing text.
.IP "[\fILINE\fR][\fB,\fR\fILINE\fR][\fB?\fR]\fBs\fR\fISUBSTRING\fR: Search for a substring" 4
.IX Item "[LINE][,LINE][?]sSUBSTRING: Search for a substring"
Search for the first line containing the specified substring.
.Sp
If you omit the first parameter, start searching from the current line.
.Sp
If you omit the second parameter, stop the search at the end of the
buffer.
.Sp
If you include the \fB?\fR (question mark), edlin will print a confirmation
message. Responding "no" to the confirmation message continues the
search; "yes" ends the search.
.Sp
If the search found the substring, the current line will be set to the
line where the search ended.
.IP "[\fILINE\fR]\fBt \fR\fIfilename\fR: Transfer a file" 4
.IX Item "[LINE]t filename: Transfer a file"
Insert the contents of a file before the specified line number.
.Sp
If you omit the line number, insert before the current line.
.IP "[\fILINE\fR]\fBw \fR\fIfilename\fR: Write the file" 4
.IX Item "[LINE]w filename: Write the file"
Write the first \fB#\fR lines in the buffer to the specified file.
.Sp
If you omit the number parameter, write all the lines in the buffer to
the file.
.IP "\fB?\fR: Print short help notice" 4
.IX Item "?: Print short help notice"
.SH "EXIT STATUS"
.IX Header "EXIT STATUS"
\&\fBedlin\fR aborts and returns non-zero if the standard input is closed when
it expects a command, e.g. if the user presses Control-D at the command
prompt.
.SH HISTORY
.IX Header "HISTORY"
The FreeDOS \fBedlin\fR was developed by Gregory Pietsch in 2003.
.PP
The original \fBedlin\fR was created by Tim Paterson in 1980, inspired by
the CP/M context editor \fBED\fR, which itself was distantly inspired by
the Unix \fBed\fR line editor.
.SH NOTES
.IX Header "NOTES"
Unlike the original \fBedlin\fR, the FreeDOS \fBedlin\fR uses a comma (\fB,\fR)
as a parameter separator for the "replace" command (\fBr\fR) instead of
the DOS end-of-file control character (Control-Z).
.PP
The command \fBl\fR, when specified in upper case (\fBL\fR) is synonymous to
\&\fBp\fR and starts printing from the current line.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright (C) 2003\-2024 Gregory Pietsch
.PP
Copyright (C) 2025 Andrej Shadura
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBed\fR\|(1)
|