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 />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

ed<br />

did not specify file, ed uses the remembered filename, if any. In all cases,<br />

the e subcommand sets the remembered filename to the file that it has just<br />

read into the buffer. ed displays a count of the bytes in the file unless it is in<br />

quiet mode. If you have changed the current buffer since the last time its<br />

contents were written, ed warns you if you try to run an e subcommand,<br />

and does not run the subcommand. If you enter the e subcommand a<br />

second time, ed goes ahead and runs the command.<br />

f [file] Changes the remembered filename to file. ed displays the new<br />

remembered filename. If you do not specify file, ed displays the current<br />

remembered filename.<br />

1,$G/regexp/<br />

Is similar to the g command except that when ed finds a line that matches<br />

regexp, it prints the line and waits for you to type in the subcommand to be<br />

run. You cannot use the a, c, i, g, G, v, and V subcommands. If you enter<br />

&, the G subcommand reruns the last subcommand you typed in. If you just<br />

press , G does not run any subcommand for that line. Note that the<br />

subcommands input as part of the execution of the G subcommand can<br />

address and affect any lines in the buffer. If the variable _<strong>UNIX</strong>03 is set to<br />

YES, any line modified by the subcommand will be unmarked.<br />

1,$g/regexp/command<br />

Performs command on all lines that contain strings matching the regular<br />

expression regexp. This subcommand works in two passes. In the first<br />

pass, ed searches the given range of lines and marks all those that contain<br />

strings matching the regular expression regexp. The second pass performs<br />

command on those lines. If the variable _<strong>UNIX</strong>03 is set to YES, any line<br />

modified by the command will be unmarked. You cannot use !, g, G, V, or v<br />

as command. command consists of one or more ed subcommands, the first<br />

of which must appear on the same line as the g subcommand. All lines of a<br />

multiline command list, except the last, must end with a backslash (\). If<br />

command is empty, ed assumes it to be the p subcommand. If no lines<br />

match regexp, ed does not change the current line number; otherwise, the<br />

current line number is the one set by the last subcommand in command.<br />

Instead of the slash (/) to delimit regexp, you can use any character other<br />

than space or newline.<br />

H Tells ed to display more descriptive messages when errors occur. If ed is<br />

already printing descriptive messages, H returns to terse error messages.<br />

Normally, ed indicates error messages by displaying a ?. When you turn on<br />

descriptive error messages with this subcommand, ed also displays the<br />

descriptive message for the most recent ? message.<br />

h Provides a brief explanation of the last error that occurred. This does not<br />

change the current line number.<br />

.i Works similarly to the a subcommand, except that ed places the text before<br />

the addressed line. Valid addresses range from line 1 to $ (the last line). ed<br />

sets the current line number to the last inserted line. If the variable<br />

_<strong>UNIX</strong>03 is set to YES, address 0 is valid for this subcommand and it will<br />

be interpreted as if address 1 were specified.<br />

.,.+1j Joins a range of lines into one line. To be precise, the j command removes<br />

all newline characters from the addressed range of lines, except for the last<br />

one. ed sets the current line number to the resulting combined line.<br />

.kx Marks the addressed line with the mark name x, which is any single<br />

lowercase letter of the alphabet. This lets you refer to a marked line with<br />

250 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!