Linux Today: Linux News On Internet Time.

More on LinuxToday

SunWorld: Hands-off editing with sed, Part 2

Feb 07, 2000, 00:47 (0 Talkback[s])
(Other stories by Mo Budlong)


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

"At the simplest level, sed reads in a line of text, applies the first transformation rule to it, then the second, then the third, and so on until all transformation rules are used up. The resulting changed line is then output. Here are some simple rules to remember when writing sed scripts:"

"1.All editing commands in a script are applied, in order, to each line of input.
2.Each command is applied to all the lines unless the line address limits the affected lines.
3.Original files are unchanged. The output result is written to standard output."

"The last rule is perhaps the most calming because sed can be scary to a new user and appears to be an automated, out of control, seek-and-destroy utility."

Complete Story

Related Stories: