From 026d91a981e34f07287ab5ec1998a416289c59b1 Mon Sep 17 00:00:00 2001 From: Alex Myczko Date: Thu, 23 Jan 2025 12:03:53 +0100 Subject: [PATCH] Add files via upload --- edlin.pod | 268 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 edlin.pod diff --git a/edlin.pod b/edlin.pod new file mode 100644 index 0000000..8926d41 --- /dev/null +++ b/edlin.pod @@ -0,0 +1,268 @@ +=head1 NAME + +edlin - FreeDOS line-oriented text editor + +=head1 SYNOPSIS + +B [I] + +=head1 DESCRIPTION + +The FreeDOS B program is a small line-oriented text editor. Unline +screen-based editors, B does not display the text being edited +at all times, instead only showing parts of it upon the user's request. + +When invoked, B 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. + +In general, the structure of an B command is as follows: + +=over + +[I[,I]]I[I] + +=back + +A line number can be one of the following: + +=over + +=item A sequence of digits as a literal line number, such as B<12> +for line 12. + +=item A full stop (B<.>), meaning the current line in the file. + +=item A dollar sign (B<$>), meaning the last line in the file. + +=item A hash sign (B<#>), meaning the line number just after the last +line in the file. + +=item A number added or subtracted from a line number (B<+I> or +B<-I>). This is useful for relative line addressing, such as B<.+1> +for the line after the current line. + +=back + +String parameters may be enclosed in either single or double quotes, +and may contain the following escape sequences: + +=over + +=item B<\a>: Alert character + +=item B<\b>: Backspace character + +=item B<\e>: Escape + +=item B<\f>: Form feed + +=item B<\t>: Horizontal tab + +=item B<\v>: Vertical tab + +=item B<">: Double quote + +=item B<'>: Single quote + +=item B<.>: Full stop + +=item B<\>: Backslash + +=item B<\x>I: Hexadecimal value, where each B is a hexadecimal +digit (B<0> to B, uppercase or lowercase) + +=item B<\d>I: Decimal value, where each B is a decimal digit +(B<0> to B<9>) + +=item B<\O>I: Octal value, where each B is an octal digit (B<0> +to B<7>) + +=item B<\^>I: Control character, such as B<\^J> for the literal +"control J" (linefeed) character. + +=back + +=head1 COMMAND SYNOPSIS + +The edlin program supports the following editor commands: + +=over + +=item B<#>: 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. + +=item B: Append to the file + +This command is equivalent to B<$+1i> + +=item [I]B<,>[I]B<,>IB<,>[I]B: Copy a range +of lines + +Copy a range of consecutive lines to another location in the buffer. The +parameters are, in order: + +=over + +=item 1. The first line you want to copy (default is the current line) + +=item 2. The last line you want to copy (default is the current line) + +=item 3. The line before which you want to I the block of lines + +=item 4. The number of times you want to copy the block (default is 1) + +=back + +After copying lines, use the B (list) command to see the new line +numbers. + +=item [I][B<,>I]B: 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. + +If you omit the first parameter, delete the block from the current line +I (be sure to include the +comma). + +If you omit the second parameter, delete I the line specified in +the first parameter. + +Omitting both parameters deletes the current line. + +=item BI: Save and exit + +This command is equivalent to BI followed by B + +This verifies whether the user actually wants to quit before doing so. +To quit, answer the "Abort edit (Y/N)?" prompt with "yes." + +=item [I]B: Insert lines + +Enter insert mode. Its parameter is the line number I which you +want to insert lines. + +While entering text, you can use the escape sequences from above. + +To exit insert mode, type B<.> (full stop) on a line by itself. (If you +need a line with just a period, you need to enter it as B<\.>) + +After exiting insert mode, the line I 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. + +=item [I][B<,>I]B: 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. + +If you omit the second parameter, shows a screen of text beginning with +the line specified in the first parameter. + +If you omit both parameters, show a screen of text starting at 11 lines +before the current line. + +If the number of lines to show is longer than the number of lines on the +screen, edlin will prompt after each screen. + +=item [I]B<,>[I]B<,>IB: 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. + +=item [I][B<,>I]B

: Print lines + +Similar to the B (list) command except that the default parameters +starts at the current line instead of 11 lines before it. + +=item B: Quit + +Quit the program. + +This verifies whether the user actually wants to quit before doing so. +To quit, answer the \"Abort edit (Y/N)?\" prompt with \"yes.\" + +=item [I][B<,>I][B]BIB<,>I: +Replace string + +Replace all occurrences of the first string with the second between the +two lines specified. + +If you omit the first parameter, start replacing at the line I the +current line. + +If you omit the second parameter, stops replacing text at the last line +of the buffer. + +If you include the B (question mark), edlin will print a confirmation +message before replacing text. + +=item [I][B<,>I][B]BI: Search for a substring + +Search for the first line containing the specified substring. + +If you omit the first parameter, start searching from the current line. + +If you omit the second parameter, stop the search at the end of the +buffer. + +If you include the B (question mark), edlin will print a confirmation +message. Responding "no" to the confirmation message continues the +search; "yes" ends the search. + +If the search found the substring, the current line will be set to the +line where the search ended. + +=item [I]BI: Transfer a file + +Insert the contents of a file before the specified line number. + +If you omit the line number, insert before the current line. + +=item [I]BI: Write the file + +Write the first B<#> lines in the buffer to the specified file. + +If you omit the number parameter, write all the lines in the buffer to +the file. + +=item B: Print short help notice + +=back + +=head1 EXIT STATUS + +B 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. + +=head1 HISTORY + +The FreeDOS B was developed by Gregory Pietsch in 2003. + +The original B was created by Tim Paterson in 1980, inspired by +the CP/M context editor B, which itself was distantly inspired by +the Unix B line editor. + +=head1 NOTES + +Unlike the original B, the FreeDOS B uses a comma (B<,>) +as a parameter separator for the "replace" command (B) instead of +the DOS end-of-file control character (Control-Z). + +The command B, when specified in upper case (B) is synonymous to +B

and starts printing from the current line. + +=head1 COPYRIGHT + +Copyright (C) 2003-2024 Gregory Pietsch + +Copyright (C) 2025 Andrej Shadura + +=head1 SEE ALSO + +L