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 thing that struck me forcefully was the feeling of great age about the place. Standing on that old parade ground, which is now a cricket field, I could feel the dead generations crowding me. Here was the oldest settlement of freedmen in the Western world, no doubt. Men who had thrown off the bands of slavery by their own courage and ingenuity. The courage and daring of the Maroons strike like a purple beam across the history of Jamaica.
    Zora Neale Hurston (1891–1960)

    History, as an entirety, could only exist in the eyes of an observer outside it and outside the world. History only exists, in the final analysis, for God.
    Albert Camus (1913–1960)

    The disadvantage of men not knowing the past is that they do not know the present. History is a hill or high point of vantage, from which alone men see the town in which they live or the age in which they are living.
    Gilbert Keith Chesterton (1874–1936)