old-www/LDP/Bash-Beginners-Guide/html/chap_05.html

315 lines
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>The GNU sed stream editor</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Bash Guide for Beginners"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Exercises"
HREF="sect_04_05.html"><LINK
REL="NEXT"
TITLE="Introduction"
HREF="sect_05_01.html"></HEAD
><BODY
CLASS="chapter"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Bash Guide for Beginners</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sect_04_05.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sect_05_01.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="chap_05"
></A
>Chapter 5. The GNU sed stream editor</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>5.1. <A
HREF="sect_05_01.html"
>Introduction</A
></DT
><DD
><DL
><DT
>5.1.1. <A
HREF="sect_05_01.html#sect_05_01_01"
>What is sed?</A
></DT
><DT
>5.1.2. <A
HREF="sect_05_01.html#sect_05_01_02"
>sed commands</A
></DT
></DL
></DD
><DT
>5.2. <A
HREF="sect_05_02.html"
>Interactive editing</A
></DT
><DD
><DL
><DT
>5.2.1. <A
HREF="sect_05_02.html#sect_05_02_01"
>Printing lines containing a pattern</A
></DT
><DT
>5.2.2. <A
HREF="sect_05_02.html#sect_05_02_02"
>Deleting lines of input containing a pattern</A
></DT
><DT
>5.2.3. <A
HREF="sect_05_02.html#sect_05_02_03"
>Ranges of lines</A
></DT
><DT
>5.2.4. <A
HREF="sect_05_02.html#sect_05_02_04"
>Find and replace with sed</A
></DT
></DL
></DD
><DT
>5.3. <A
HREF="sect_05_03.html"
>Non-interactive editing</A
></DT
><DD
><DL
><DT
>5.3.1. <A
HREF="sect_05_03.html#sect_05_03_01"
>Reading sed commands from a file</A
></DT
><DT
>5.3.2. <A
HREF="sect_05_03.html#sect_05_03_02"
>Writing output files</A
></DT
></DL
></DD
><DT
>5.4. <A
HREF="sect_05_04.html"
>Summary</A
></DT
><DT
>5.5. <A
HREF="sect_05_05.html"
>Exercises</A
></DT
></DL
></DIV
><BLOCKQUOTE
CLASS="ABSTRACT"
><DIV
CLASS="abstract"
><A
NAME="AEN3619"
></A
><P
></P
><P
>At the end of this chapter you will know about the following topics:</P
><P
><P
></P
><UL
><LI
><P
>What is <B
CLASS="command"
>sed</B
>?</P
></LI
><LI
><P
>Interactive use of <B
CLASS="command"
>sed</B
></P
></LI
><LI
><P
>Regular expressions and stream editing</P
></LI
><LI
><P
>Using <B
CLASS="command"
>sed</B
> commands in scripts</P
></LI
></UL
></P
><P
>&#13;<DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>This is an introduction</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>These explanations are far from complete and certainly not meant to be used as the definite user manual for <B
CLASS="command"
>sed</B
>. This chapter is only included in order to show some more interesting topics in the next chapters, and because every power user should have a basic knowledge of things that can be done with this editor.</P
><P
>For detailed information, refer to the <B
CLASS="command"
>sed</B
> info and man pages.</P
></TD
></TR
></TABLE
></DIV
>
</P
><P
></P
></DIV
></BLOCKQUOTE
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sect_04_05.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sect_05_01.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Exercises</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Introduction</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>