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

ed<br />

the current line to the last line on which a substitution occurred. If ed makes<br />

no such replacements, ed considers it an error.<br />

flags can be one of the following:<br />

n Replaces the nth matching string in the line instead of the first one.<br />

g Replaces every matching string in each line, not just the first one.<br />

l Displays the new current line in the format of the l subcommand.<br />

n Displays the new current line in the format of the n subcommand.<br />

p Displays the new current line in the format of the p subcommand.<br />

You can use any single printable character other than space or newline<br />

instead of / to separate parts of the subcommand provided that you use the<br />

same character to delimit all parts of the subcommand. You can omit the<br />

trailing delimiter.<br />

You can include a newline in the new string by putting a \ immediately in<br />

front of the newline. This is a good way to split a line into two lines. If new<br />

consists only of the % character, s uses the new string from the previous s<br />

command. If the variable _<strong>UNIX</strong>03=YES is set and there was no previous s<br />

command, the use of % in this manner is an error. If & appears anywhere in<br />

new, ed replaces it with the text matching the regexp. If you want new to<br />

contain a literal ampersand, or percent sign, put a backslash (\) in front of<br />

the & or % character.<br />

.,.ta Copies the addressed lines to the point after the line given by the address<br />

a. The address a must not fall in the range of addressed lines. If address a<br />

is 0, ed copies the lines to the beginning of the buffer. This sets the current<br />

line to the last line copied.<br />

u Rolls back the effect of the last subcommand that changed the buffer. For<br />

the purposes of u, subcommands that change the buffer are: a, c, d, g, G,<br />

i, j, m, r, s, t, v, V, and (of course) u. This means that typing u repeatedly<br />

switches the most recent change back and forth. This subcommand sets<br />

the current line number to the value it had immediately before the<br />

subcommand being undone started.<br />

1,$V/regexp/<br />

Is similar to the G subcommand, except that this subcommand gives you<br />

the chance to edit only those lines that do not match the given regular<br />

expression.<br />

1,$v/regexp/commands<br />

Is similar to the g (global) command, except that ed applies the given<br />

commands only to lines that do not match the given regular expression.<br />

1,$W [file]<br />

Is similar to the w subcommand, except that this command appends data to<br />

the given file if the file already exists.<br />

1,$w [file]<br />

Writes the addressed lines of the buffer to the named file. This does not<br />

change the current line. If you do not provide file, ed uses the remembered<br />

filename; if there is no remembered filename, file becomes the remembered<br />

name. If the output file does not exist, ed creates it. ed displays the number<br />

of characters written unless you had specified the –s option.<br />

X Prompts you to enter an encryption key. All subsequent e, r, and w<br />

subcommands use this key to decrypt or encrypt text read from or written to<br />

files. To turn encryption off, issue an X subcommand and press in<br />

response to the prompt for an encryption key.<br />

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