home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: p Chapter 10
The Sed Editor
Next: Reference: q
 

P

[

address1

][

,



address2

]

P

Print first part (up to embedded newline) of multi-line pattern created by N command. Same as p if N has not been applied to a line.

Example

Suppose you have function references in two formats:

function(a,b,c)
function(a,
         b,
         c)

The following script changes argument c , regardless of whether it appears on the same line as the function name:

s/function(a,b,c)/function(a,b,XX)/
/function(/{
N
s/c/XX/
P
D
}


Previous: Reference: p UNIX in a Nutshell: System V Edition Next: Reference: q
Reference: p Book Index Reference: q

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