Skip to content
EntityQ305876· pop 37· linked from 268 articles

sed (short for stream editor) is a utility that transforms text via a script written in a relatively simple and compact programming language. It was developed from 1973 to 1974 by Lee E. McMahon of Bell Labs, and is available today for most operating systems. The functionality of sed is based on the scripting features of the interactive editor ed ("editor", 1971) and the earlier qed ("quick editor", 1965–66). It was one of the earliest tools to support regular expressions, and remains in use for text processing, most notably with the substitution command. Popular alternative tools for text man

Key facts

Programming language.name
sed
Programming language.paradigm
scripting
Programming language.designer
Lee E. McMahon
Programming language.programming_language
C
Programming language.influenced by
ed
Programming language.influenced
Perl, AWK
Programming language.screenshot
Sed stream editor cropped1.jpg
Programming language.screenshot caption
An excerpt from GNU sed's man page
Programming language.website
hide

via Wikipedia infobox

Described at

Link to a page describing this subject · 33,206 chars · not written by Vinony

Wikidata facts

Show 4 more facts
inception
1974-01-01
has command line option
n
Sources (5)

via Wikidata · CC0

~11 min read

Article

16 sections
Contents
  • History
  • Processing
  • Use
  • Conditional execution
  • Matching
  • Substitution
  • Control flow
  • As a filter
  • Script
  • In-place editing
  • Examples
  • Limitations and alternatives
  • See also
  • References
  • Further reading
  • External links

sed (short for stream editor) is a utility that transforms text via a script written in a relatively simple and compact programming language. It was developed from 1973 to 1974 by Lee E. McMahon of Bell Labs, and is available today for most operating systems. The functionality of sed is based on the scripting features of the interactive editor ed ("editor", 1971) and the earlier qed ("quick editor", 1965–66). It was one of the earliest tools to support regular expressions, and remains in use for text processing, most notably with the substitution command. Popular alternative tools for text manipulation and stream editing include AWK and Perl. The shell command that runs the utility has the same name: .

==History== First appearing in Version 7 Unix, sed is one of the early Unix utilities built for command line processing of data files. It evolved as the natural successor to the popular grep command. The original motivation was an analogue of grep (g/re/p) for substitution, hence "g/re/s". Foreseeing that further special-purpose programs for each command would also arise, such as g/re/d, McMahon wrote a general-purpose line-oriented stream editor, which became sed. The syntax for sed, notably the use of / for pattern matching, and s/// for substitution, originated with ed, the precursor to sed, which was in common use at the time, and the regular expression syntax has influenced other languages, notably ECMAScript and Perl. Later, the more powerful language AWK developed, and these functioned as cousins, allowing powerful text processing to be done by shell scripts. sed and AWK are often cited as progenitors and inspiration for Perl, and influenced Perl's syntax and semantics, notably in the matching and substitution operators.

Connections

Categories