UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: bChapter 10
The sed Editor
Next: Reference: d
 

c

[address1[,address2]]c\
text

Replace (change) the lines selected by the address(es) with text. (See a for details on text.) When a range of lines is specified, all lines as a group are replaced by a single copy of text. The contents of the pattern space are, in effect, deleted and no subsequent editing commands can be applied to the pattern space (or to text).

Example

# Replace first 100 lines in a file:
1,100c\
\
<First 100 names to be supplied>


Previous: Reference: bUNIX in a Nutshell: System V EditionNext: Reference: d
Reference: bBook IndexReference: d

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System