16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

|<br />

ed<br />

need to specify addresses for certain subcommands that use default addresses.<br />

Consult the description for a particular subcommand. You can construct each<br />

address out of the following components:<br />

. The single dot character represents the current line in the buffer. Many<br />

subcommands set the current line; for example the e command sets it to<br />

the last line of the new file being edited.<br />

$ The dollar sign refers to the last line in the buffer.<br />

n The number n refers to the nth line in the buffer.<br />

/regexp/<br />

This searches for a line containing a string that matches the regular<br />

expression, regexp. (For information on regular expressions, see<br />

Appendix F.) The search begins at the line immediately following the current<br />

line. It proceeds forward through the buffer; if ed reaches the end of the<br />

buffer without finding a match, it wraps around to the first line of the buffer<br />

and continues the search. If ed does not find a match, the search ends<br />

when it reaches the original current line. If it does find a match, the address<br />

/regexp/ refers to the first matching line. If you omit regexp, the last used<br />

regular expression becomes the object of the search. You can omit the<br />

trailing /. Within regexp, \/ represents a literal slash and not the regexp<br />

delimiter.<br />

?regexp?<br />

This is similar to the previous address form, except that the search goes<br />

backward through the buffer. If the search reaches the first line in the buffer<br />

without finding a match, ed wraps around and continues searching<br />

backward from the last line in the buffer. If you omit regexp, the last used<br />

regular expression becomes the object of the search. You can omit the<br />

trailing ?. Within regexp, \? represents a literal question mark and not the<br />

regexp delimiter.<br />

'l The address is the line marked with the mark name l. The name l must be<br />

a lowercase letter set by the k subcommand.<br />

You can combine these basic addresses with numbers using the + and – operators,<br />

with the usual interpretation. Missing left operands default to . (dot); missing right<br />

operands default to 1. Missing right operands also have a cumulative effect; so an<br />

address of – – refers to the current line number less two.<br />

You can specify address ranges in the following ways:<br />

a1,a2 Specifies a range of addresses from address a1 to address a2, inclusive. If<br />

you omit a1 and a2 (that is, the comma alone is specified), this is<br />

equivalent to the range 1,$.<br />

a1;a2 Is similar to the previous form except that ed resets the current line after<br />

calculating the first address, a1, so that the second address, a2, is relative<br />

to a1. If you omit a1 and a2 (that is, the semicolon alone is specified), this<br />

is equivalent to .;$. If you specify only a1 and the command requires both<br />

a1 and a2, the command operates as though you specified a range of:<br />

a1;. command<br />

> Is equivalent to .,.+22 (that is, page forward), except that it never attempts<br />

to address any line beyond $.<br />

< Is equivalent to .–22,. (that is, page backward), except that it never<br />

addresses any line before line 1.<br />

248 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!