This is an old revision of this page, as edited by Damian Yerrick (talk | contribs) at 23:36, 16 April 2002 (see also false friend). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Revision as of 23:36, 16 April 2002 by Damian Yerrick (talk | contribs) (see also false friend)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)Sed is a UNIX utility which allows to modify text files. It reads in its input line by line, transforms these lines according to rules specified in a certain simple language, and outputs them. The rules often involve regular expressions. "Sed" stands for Stream EDitor, but is also the Latin word for but and the Spanish word for thirst. (See also false friend.) In a typical unix pipe command, you might say something like
- generate_data | sed -e 's/x/y/'
That is, generate the data, but make these small changes.
Sed is one of the very early unix commands that permitted command line processing of data files. Cousin to the later AWK, sed allowed powerful and interesting data processing to be done by shell scripts. Sed was probably the earliest Unix tool that really encouraged regular expressions to be used ubiquitously.
Sed and AWK are often cited as the progenitors and inspiration for Perl.
Sed's language does not have variables and only primitive GOTO and branching functionality; nevertheless, the language is Turing complete.