DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Manipulating text with sed

Line addresses

A line number is a decimal integer. As sed reads lines from its input file, it increments a line counter. Each time sed reads a new line it checks whether the current line number matches any of the commands in its command list. If any of the commands match the current line number, they are carried out. The counter runs cumulatively through multiple input files; thus, if sed is reading in five files, each 100 lines long, line address 369 actually refers to the 69th line of the fourth file. The counter is not reset when new input files are opened. A special case is the dollar sign character ($) which matches the last line of the last input file.


Next topic: Context addresses
Previous topic: Addresses

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005