Sed - History

History

sed is one of the very early Unix commands built for command line processing of data files. It evolved as the natural successor to the popular grep command. Cousin to the later AWK, sed allows powerful and interesting data processing to be done by shell scripts.

sed and AWK are often cited as the progenitors and inspiration for Perl. The s / / / syntax shown below is part of Perl's syntax and originated with ed, the precursor to sed.

sed's language does not have variables and has only primitive GOTO and branching functionality; nevertheless, the language is Turing-complete.

GNU sed added several new features. The best-known is in-place editing of files (i.e., replace the original file with the result of applying the sed program), which was later included in BSD sed too. This feature is nowadays often used instead of ed scripts: for example,

sed -i 's/abc/def/' file # (the BSDs require an extension with the -i flag, e.g. sed -i .bak 's/abc/def/' file)

Note: "sed -i" overwrites the original file with a new one, breaking any links the original may have had, while the above example using "ed" changes only the original file's contents, preserving file links. Note that if using -i'extension' the original file will be preserved by renaming it with the given extension. Note also that a space cannot be used between "-i" and extension since the extension is optional.

Super-sed is an extended version of sed that includes regular expressions compatible with Perl.

Another variant of sed is minised, originally reverse-engineered from the 4.1BSD sed by Eric S. Raymond and currently maintained by René Rebe. minised was used by the GNU Project until the GNU Project wrote a new version of sed based on the new GNU regular expression library. The current minised contains some extensions to BSD sed but is not as feature-rich as GNU sed. Its advantage is that it is very fast and uses little memory. It is used on embedded systems and is the version of sed provided with Minix.

Read more about this topic:  Sed

Famous quotes containing the word history:

    The History of the world is not the theatre of happiness. Periods of happiness are blank pages in it, for they are periods of harmony—periods when the antithesis is in abeyance.
    Georg Wilhelm Friedrich Hegel (1770–1831)

    The history of reform is always identical; it is the comparison of the idea with the fact. Our modes of living are not agreeable to our imagination. We suspect they are unworthy. We arraign our daily employments.
    Ralph Waldo Emerson (1803–1882)

    The visual is sorely undervalued in modern scholarship. Art history has attained only a fraction of the conceptual sophistication of literary criticism.... Drunk with self-love, criticism has hugely overestimated the centrality of language to western culture. It has failed to see the electrifying sign language of images.
    Camille Paglia (b. 1947)