Edlin

Last updated
Edlin
Original author(s) Tim Paterson
Developer(s) Microsoft, IBM, Gregory Pietsch
Initial release1980;43 years ago (1980)
Written in MS-DOS: x86 assembly language
Operating system 86-DOS, IBM PC DOS, MS-DOS, FreeDOS, OS/2, eComStation, ArcaOS, Windows
Type Line editor
License MS-DOS: MIT
FreeDOS, ReactOS: GPL
86-DOS, PC DOS, OS/2, Windows: Proprietary commercial software
Website Edlin

Edlin is a line editor, and the only text editor provided with early versions of IBM PC DOS, [1] MS-DOS and OS/2. [2] Although superseded in MS-DOS 5.0 and later by the full-screen MS-DOS Editor, and by Notepad in Microsoft Windows, it continues to be included in the 32-bit versions of current Microsoft operating systems.

Contents

History

EDLIN.COM (among several other commands) in IBM PC DOS 1.0 IBM PC DOS 1.0 screenshot.png
EDLIN.COM (among several other commands) in IBM PC DOS 1.0
Using EDLIN for typing Japanese with the ATOK 8 input method editor, running on MS-DOS 3.3C for the PC-9800 series ATOK 8 for PC-98 screenshot.png
Using EDLIN for typing Japanese with the ATOK 8 input method editor, running on MS-DOS 3.3C for the PC-9800 series

Edlin was created by Tim Paterson in two weeks in 1980, for Seattle Computer Products's 86-DOS (QDOS) [3] based on the CP/M context editor ED, [4] [5] itself a distant derivative of the Unix ed line editor.

Microsoft acquired 86-DOS and, after some further development, sold it as MS-DOS, so Edlin was included in v1.0–v5.0 of MS-DOS. From MS-DOS 6 onwards, the only editor included was the new full-screen MS-DOS Editor.

Windows 95, 98 and ME ran on top of an embedded version of DOS, which reports itself as MS-DOS 7. As a successor to MS-DOS 6, this did not include Edlin.

However, Edlin is included in the 32-bit versions of Windows NT [6] and its derivatives—up to and including Windows 10—because the NTVDM's DOS support in those operating systems is based on MS-DOS version 5.0. However, unlike most other external DOS commands, it has not been transformed into a native Win32 program. It also does not support long filenames, which were not added to MS-DOS and Windows until long after Edlin was written.

The FreeDOS version was developed by Gregory Pietsch. [7]

Usage

There are only a few commands. The short list can be found by entering a ? at the edlin prompt.

When a file is open, typing L lists the contents (e.g., 1,6L lists lines 1 through 6). Each line is displayed with a line number in front of it.

*1,6L        1: Edlin: The only text editor in early versions of DOS.        2:        3: Back in the day, I remember seeing web pages        4: branded with a logo at the bottom:        5: "This page created in edlin."        6: The things that some people put themselves through. ;-) *

The currently selected line has a *. To replace the contents of any line, the line number is entered and any text entered replaces the original. While editing a line pressing Ctrl-C cancels any changes. The * marker remains on that line.

Entering I (optionally preceded with a line number) inserts one or more lines before the * line or the line given. When finished entering lines, Ctrl-C returns to the edlin command prompt.

*6I        6:*(...or similar)        7:*^C    *7D *L        1: Edlin: The only text editor in early versions of DOS.        2:        3: Back in the day, I remember seeing web pages        4: branded with a logo at the bottom:        5: "This page created in edlin."        6: (...or similar) *
i - Inserts lines of text.
D - deletes the specified line, again optionally starting with the number of a line, or a range of lines. E.g.: 2,4d deletes lines 2 through 4. In the above example, line 7 was deleted.
R - is used to replace all occurrences of a piece of text in a given range of lines, for example, to replace a spelling error. Including the ? prompts for each change. E.g.: To replace 'prit' with 'print' and to prompt for each change: ?rprit^Zprint (the ^Z represents pressing CTRL-Z). It is case-sensitive.
S - searches for given text. It is used in the same way as replace, but without the replacement text. A search for 'apple' in the first 20 lines of a file is typed 1,20?sapple (no space, unless that is part of the search) followed by a press of enter. For each match, it asks if it is the correct one, and accepts n or y (or Enter).
P - displays a listing of a range of lines. If no range is specified, P displays the complete file from the * to the end. This is different from L in that P changes the current line to be the last line in the range.
T - transfers another file into the one being edited, with this syntax: [line to insert at]t[full path to file].
W - (write) saves the file.
E - saves the file and quits edlin.
Q - quits edlin without saving.

Scripts

Edlin may be used as a non-interactive file editor in scripts by redirecting a series of edlin commands.

edlin < script

FreeDOS Edlin

A GPL-licensed clone of Edlin that includes long filename support is available for download as part of the FreeDOS project. This runs on operating systems such as Linux or Unix as well as MS-DOS. [8]

See also

Related Research Articles

ed (text editor) Line-oriented text editor for Unix

ed is a line editor for Unix and Unix-like operating systems. It was one of the first parts of the Unix operating system that was developed, in August 1969. It remains part of the POSIX and Open Group standards for Unix-based operating systems, alongside the more sophisticated full-screen editor vi.

<span class="mw-page-title-main">Shell script</span> Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

<span class="mw-page-title-main">WordStar</span> Word processor application

WordStar is a word processor application for microcomputers. It was published by MicroPro International and originally written for the CP/M-80 operating system, with later editions added for MS-DOS and other 16-bit PC OSes. Rob Barnaby was the sole author of the early versions of the program.

<span class="mw-page-title-main">COMMAND.COM</span> Default command line for MS-DOS and Windows 9x

COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot, hence being responsible for setting up the system by running the AUTOEXEC.BAT configuration file, and being the ancestor of all processes.

<span class="mw-page-title-main">Windows Notepad</span> Simple text editor included with Microsoft Windows

Windows Notepad is a simple text editor for Windows; it creates and edits plain text documents. First released in 1983 to commercialize the computer mouse in MS-DOS, Notepad has been part of every version of Windows ever since.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

In computing, a hard link is a directory entry that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file accessible via additional paths. This causes an alias effect: a process can open the file by any one of its paths and change its content. By contrast, a soft link or “shortcut” to a file is not a direct link to the data itself, but rather a reference to a hard link or another soft link.

<span class="mw-page-title-main">DOSKEY</span>

DOSKEY is a command for DOS, IBM OS/2, Microsoft Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the command-line interpreters COMMAND.COM and cmd.exe.

<span class="mw-page-title-main">Norton Commander</span> Discontinued orthodox file manager software

Norton Commander (NC) is a discontinued prototypical orthodox file manager (OFM), written by John Socha and released by Peter Norton Computing. NC provides a text-based user interface for managing files on top of MS-DOS. It was officially produced between 1986 and 1998. The last MS-DOS version of Norton Commander, 5.51, was released on July 1, 1998.

Command-line completion is a common feature of command-line interpreters, in which the program automatically fills in partially typed commands.

<span class="mw-page-title-main">MS-DOS Editor</span>

MS-DOS Editor, commonly just called edit or edit.com, is a TUI text editor that comes with MS-DOS 5.0 and later, as well as all "x86" SKUs of Windows, until Windows 11. It supersedes edlin, the standard editor in earlier versions of MS-DOS. In MS-DOS, it was a stub for QBasic running in editor mode. Starting with Windows 95, MS-DOS Editor became a standalone program because QBasic didn't ship with Windows.

more (command) Terminal pager available on various operating systems

In computing, more is a command to view the contents of a text file one screen at a time. It is available on Unix and Unix-like systems, DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows and ReactOS. Programs of this sort are called pagers. more is a very basic pager, originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement.

tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

<span class="mw-page-title-main">TYPE (DOS command)</span>

In computing, type is a command in various command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell used to display the contents of specified files on the computer terminal. The analogous Unix command is cat.

del (command) Command in various operating systems

In computing, del is a command in command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system.

find (Windows)

In computing, find is a command in the command-line interpreters (shells) of a number of operating systems. It is used to search for a specific text string in a file or files. The command sends the specified lines to the standard output device.

choice (command)

In computing, choice is a command that allows for batch files to prompt the user to select one item from a set of single-character choices. It is available in a number of operating system command-line shells.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as a user-friendly alternative to punched cards.

References

  1. "Disk Operating System" (PDF). Bitsavers.org. January 1982. Retrieved 24 January 2022.
  2. "OS/2 1.0". Os2museum.com.
  3. "A Short History of MS-DOS". Patersontech.com.
  4. "ED Utility". Shaels.net. Archived from the original on 20 June 2013. Retrieved 24 January 2022.
  5. "ED: A Context Editor for The CP/M Disk System". archive.org. 1978. Retrieved 8 May 2023.
  6. 16-Bit Applications Included with Windows NT, Microsoft.com
  7. "FreeDOS Package -- edlin (FreeDOS Base)". Ibiblio.org.
  8. "FreeDOS Edlin". Sourceforge.net. 3 March 2023.

Further reading