| |
| | sed_tutorial (Site not responding. Last check: 2007-10-27) |
 | | Sed reads one line at a time, chops off the terminating newline, puts what is left into the pattern space (buffer) where the sed script can process it (often using regular expressions), then if there anything to print - sed appends a newline and prints out the result (usually to stdout). |
 | | note, that since sed programs often contain regular expressions, they will often contain characters that your shell interprets, so you should get used to put all sed programs in single quotes so your shell won't interpret the sed program. |
 | | For example, we can't use sed -e '$-10,$d', since sed doesn't know $ before the end of file, so it doesn't know where $-10 is. This is a major problem, and it limits sed(1)'s usefulness, but sed(1) still has a large number of appliances. |
| www.selectorweb.com /sed_tutorial.html (1402 words) |
|