«
»

A powerful command, SED

September 28th, 2005 by George Notaras

SED is powerful. It can, besides many other things, substitute, append, remove characters or groups of characters or whole lines in a text file or the console output. You may find it difficult to use, but here is an excellent web page that will help you get going:

Bruce Barnett writes in his article:

Sed is the ultimate stream editor. If that sounds strange, picture a stream flowing through a pipe. Okay, you can’t see a stream if it’s inside a pipe. That’s what I get for attempting a flowing analogy. You want literature, read James Joyce.

Anyhow, sed is a marvelous utility. Unfortunately, most people never learn its real power. The language is very simple, but the documentation is terrible. The Solaris on-line manual pages for sed are five pages long, and two of those pages describe the 34 different errors you can get. A program that spends as much space documenting the errors than it does documenting the language has a serious learning curve.

Do not fret! It is not your fault you don’t understand sed. I will cover sed completely. But I will describe the features in the order that I learned them. I didn’t learn everything at once. You don’t need to either.

Read on…

The A powerful command, SED by George Notaras, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Tags: , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre>