P - Print.

Syntax:

P
<nl>

Examples:

p       5p      *p      .,/abc/p
5       ^       *       1,7

Description:

P displays one or more lines on the terminal. If you do not specify an address, P displays the current line. If you specify one address, P displays that line instead. If you specify two addresses, P displays all the lines between and including the two given lines. In this case, the first address must precede the second. After the lines are printed, P sets "." to the last line printed.

A completely empty line (just the new-line nl character) is equivalent to .P if the current line has changed since the last time it was printed out, and .+1P otherwise. "." is set to whatever line is printed out.

The form

/string/

has one special characteristic: if O-S/ is in effect, the closing / may be omitted. The same is true with -/string/.

Copyright © 1998, Thinkage Ltd.