01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SED ( 1) SED ( 1)<br />

In the following list of functions the maximum number of permissible<br />

addresses for each function is indicated in parentheses.<br />

The text argument consists of one or more lines, all but the last of<br />

which end with \ to hide the new-line. Backslashes in text are<br />

treated like backslashes in the replacement string of an s com- ""'<br />

mand, and may be used to protect initial blanks and tabs against 1<br />

the stripping that is done on every script line. The rfile or wfile<br />

argument must terminate the command line and must be preceded<br />

by exactly one blank. Each wfile is created before processing<br />

begins. There can be at most 10 distinct wfile arguments.<br />

(1) a\<br />

text<br />

(2) b label<br />

(2) c\<br />

text<br />

(2) d<br />

(2) D<br />

(2) g<br />

(2) G<br />

(2) h<br />

(2) H<br />

(l) i\<br />

text<br />

(2) 1<br />

(2) n<br />

(2) N<br />

(2) p<br />

(2) p<br />

(1) q<br />

Append. Place text on the output before reading the<br />

next input line.<br />

Branch to the : command bearing the label. If label is<br />

empty, branch to the end of the script.<br />

Change. Delete the pattern space. With 0 or 1<br />

address or at the end of a 2-address range, place text<br />

on the output. Start the next cycle.<br />

Delete the pattern space. Start the next cycle.<br />

Delete the initial segment of the pattern space through<br />

the first new-line. Start the next cycle.<br />

Replace the contents of the pattern space by the contents<br />

of the hold space.<br />

Append the contents of the hold space to the pattern<br />

space.<br />

Replace the contents of the hold space by the contents<br />

of the pattern space.<br />

Append the contents of the pattern space to the hold<br />

space.<br />

Insert. Place text on the standard output.<br />

List the pattern space on the standard output in an<br />

unambiguous form. Non-printing characters are<br />

spelled in two-digit ASCII and long lines are folded.<br />

Copy the pattern space to the standard output.<br />

Replace the pattern space with the next line of input.<br />

Append the next line of input to the pattern space<br />

with an embedded new-line. (The current line number<br />

changes.)<br />

Print. Copy the pattern space to the standard output.<br />

Copy the initial segment of the pattern space through<br />

the first new-line to the standard output.<br />

Quit. Branch to the end of the script. Do not start a<br />

new cycle.<br />

(2) r rfile Read the contents of rfile. Place them on the output<br />

before reading the next input line.<br />

(2) sl regular expression I replacement I flags<br />

Substitute the replacement string for instances of the<br />

regular expression in the pattern space. Any character<br />

may be used instead of f. For a fuller description<br />

see ed(1). Flags is zero or more of:<br />

- 2-

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

Saved successfully!

Ooh no, something went wrong!