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:

    Jesus Christ belonged to the true race of the prophets. He saw with an open eye the mystery of the soul. Drawn by its severe harmony, ravished with its beauty, he lived in it, and had his being there. Alone in all history he estimated the greatness of man.
    Ralph Waldo Emerson (1803–1882)

    Three million of such stones would be needed before the work was done. Three million stones of an average weight of 5,000 pounds, every stone cut precisely to fit into its destined place in the great pyramid. From the quarries they pulled the stones across the desert to the banks of the Nile. Never in the history of the world had so great a task been performed. Their faith gave them strength, and their joy gave them song.
    William Faulkner (1897–1962)

    We know only a single science, the science of history. One can look at history from two sides and divide it into the history of nature and the history of men. However, the two sides are not to be divided off; as long as men exist the history of nature and the history of men are mutually conditioned.
    Karl Marx (1818–1883)