FACTOID # 182: China loses 2 million people per year.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Ed (Unix)

The text editor ed was the original standard on the Unix operating system. ed was originally written by Ken Thompson and contains one of the first implementations of regular expressions. Prior to that implementation, the concept of regular expressions was only formalized in a mathematical paper, which Ken Thompson had read. ed was influenced by an earlier editor known as QED from University of California at Berkeley, Ken Thompson's alma mater. ed went on to influence ex, which in turn spawned vi. The non-interactive Unix commands grep and sed were inspired by common special uses of ed; their influence is visible in the design of the programming language AWK, which in turn inspired aspects of Perl. Notepad is the standard text editor for Microsoft Windows A text editor is a piece of computer software for editing plain text. ... Unix or UNIX is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ... Ken Thompson Kenneth Thompson (born February 4, 1943) is a computer scientist notable for his contributions to the development of the C programming language and the UNIX operating system. ... A regular expression (abbreviated as regexp or regex, with plural forms regexps, regexes, or regexen) is a string that describes or matches a set of strings, according to certain syntax rules. ... QED is a line-oriented computer text editor. ... Ex (disambiguation) ex, short for EXtended, was a line editor for UNIX. It was an advanced version of the standard UNIX editor ed, included in the Berkeley Software Distribution. ... The correct title of this article is vi. ... grep is a command line utility originally written for use with the Unix operating system. ... The correct title of this article is sed. ... AWK is a general purpose computer language that is designed for processing text-based data, either in files or data streams. ... Programming Republic of Perl logo Perl, also Practical Extraction and Report Language (a backronym, see below), is a programming language released by Larry Wall on December 18, 1987 that borrows features from C, sed, awk, shell scripting (sh), and (to a lesser extent) from many other programming languages. ...


Famous for its terseness, ed has almost no visual feedback. For example, the message that ed will produce in case of error, or when it wants to make sure you want to quit without saving, is "?". It does not report the current filename or line number, or even display the results of a change to the text, unless requested. This terseness was appropriate in the early versions of Unix, when consoles were teletypes, modems were slow, and hard disk and memory were precious. When these advantages ceased to apply, more interactive editors became the standard. A teleprinter (teletypewriter, teletype or TTY) is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from point to point through a simple electrical communications channel, often just a pair of wires. ... A modem (a portmanteau constructed from modulator and demodulator) is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information. ... Typical hard drives of the mid-1990s. ... A four-megabyte RAM hiyaacard for the VAX 8600 computer (circa 1986). ...


In current practice ed is rarely used interactively, but does find use in some shell scripts. For interactive use, ed was subsumed by the sam, vi and Emacs editors in the 1980s. ed can be found on virtually every version of Unix and Linux available, and as such is useful for people who have to work with multiple versions of Unix. If something goes wrong, ed is sometimes the only editor available. This is often the only time when it is used interactively. A shell script is a script written for the shell, or command interpreter, of an operating system. ... Sam is a multi-file text editor originally designed at Bell Labs by Rob Pike (with the help of Ken Thompson and other Unix developers) in the early 1980s for the DMD 5620 windowing terminal running Unix. ... The correct title of this article is vi. ... This article is about the text editor. ... MacGyver - 1980s hero The 1980s decade refers to the years from 1980 to 1989, inclusive. ... Linux (also known as GNU/Linux) is a computer operating system. ...


The ed commands are often imitated in other line-based editors. For example, EDLIN in early MS-DOS versions had a somewhat similar syntax, and text editors in many MUDs (LPMud and descendants, for example) use ed-like syntax. These editors, however, are typically more limited in function. The EDLIN line editor was the only text editor provided with MS-DOS before version 5. ... Microsofts disk operating system, MS-DOS, was Microsofts implementation of DOS, which was the first popular operating system for the IBM PC, and until recently, was widely used on the PC compatible platform. ... In computer gaming, a MUD (Multi-User Dungeon or Domain or Dimension) is a multi-player computer game that combines elements of role-playing games, hack and slash style computer games and social instant messaging chat rooms. ... LPMud (sometimes shortened to simply LP) is a MUD variant developed in 1989 by Lars Pensjö that separates the mud game functionality between a virtual machine (known as the driver) and world-building components in the LPC programming language (known as the mudlib). ...

Contents


Example session

Here is an example transcript of an ed session:

 a ed is the standard Unix text editor. This is line number two. . 2i . 1,$l ed is the standard Unix text editor.$ $ This is line number two.$ 3s/two/three/ 1,$l ed is the standard Unix text editor.$ $ This is line number three.$ w text 65 q 

The end result is a simple text file containing the following text:

 ed is the standard Unix text editor. This is line number three. 

Explanation of the example

Here we started with an empty file, and used a to append text (all ed commands are single letters). That put us into insert mode, which is terminated by a singular dot on a line. The two lines that we entered before the dot end up in the file buffer. 2i goes into insert mode, and will insert the entered text (a single empty line in our case) before line two. All commands may be prefixed by a line number and will operate on that line.


In 1,$l the l stands for the list command. This time we prefixed the command by a range, two lines separated by a comma ($ means the last line). In return, ed is listing all lines, from first to last. These lines are ended with dollar signs, so that white space at the end of lines is clearly visible.


We will correct the error in line 3 with 3s/two/three/, a substitution command. The 3 will apply it to the right line, following the command is the text to be replaced, and then the replacement. Listing all lines again with 1,$l we see that the line is correct now.


w text writes the buffer to the file "text". ed responds with 65, which is the number of characters that it wrote to the file. q will end our ed session.


Bill Joy, vi, and ed

In the editor wars, emacs proponents used to say, "even Bill Joy doesn't use vi anymore." The hacker community has a tradition of treating their favorite text editor with a reverence bordering on religious fanaticism. ... This article is about the text editor. ... William Nelson Joy (born 1954), commonly known as Bill Joy, co-founded Sun Microsystems in 1982 along with Vinod Khosla, Scott McNealy and Andy Bechtolsheim, and served as chief scientist at the company until 2003. ...


In a 1985 interview Bill Joy explained that, at Sun, he used an early desktop publishing program, called Interleaf; when visiting labs outside Sun, he used plain old ed. Although vi was almost ubiquitous, he could not count on the local version working the way he expected. However, ed was never modified, so he could count on making it work without making himself look like a fool. This article is about the year. ... Sun Microsystems, Inc. ... Founded in 1981, Interleaf was a company that produced a technical publishing software product with the same name. ...


See also

This is a list of Unix programs. ...

External links



 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m