start page | rating of books | rating of authors | reviews | copyrights

UNIX in a Nutshell: System V Edition

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

P

[address1[,address2]]P

Print first part (up to embedded newline) of multiline pattern space 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(arg1, arg2)
function(arg1,
         arg2)

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

s/function(arg1, arg2)/function(arg1, XX)/
/function(/{
N
s/arg2/XX/
P
D
}


Previous: Reference: pUNIX in a Nutshell: System V EditionNext: Reference: q
Reference: pBook IndexReference: q

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