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

Create successful ePaper yourself

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

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

Options<br />

–E Uses extended regular expressions. Normally, sed uses basic regular<br />

expressions. For more information, see Appendix C.<br />

–e script<br />

Adds the editing subcommands script to the end of the script.<br />

–f scriptfile<br />

Adds the subcommands in the file scriptfile to the end of the script.<br />

–n Suppresses all output except that generated by explicit subcommands in<br />

the sed script [acilnpPr]<br />

If you need only one script argument, you can omit the –e and use the first form of<br />

the command.<br />

sed subcommands are similar to those of the interactive text editor ed, except that<br />

sed subcommands necessarily view the input text as a stream rather than as a<br />

directly addressable file.<br />

Each line of a sed script consists of one or more editing commands. The<br />

commands can be preceded by either semicolons or blanks, or both. Each editing<br />

command contains up to two addresses, a single letter command, and possible<br />

command arguments. The last editing command is followed with a terminating<br />

newline. The newline is optional in script strings typed on the command line.<br />

[addr[,addr]] command [arguments]<br />

Subcommands<br />

sed subcommands necessarily view the input text as a stream rather than as a<br />

directly addressable file. Script subcommands can begin with zero, one, or two<br />

addresses, as in ed.<br />

v Zero-address subcommands refer to every input line.<br />

v One-address subcommands select only those lines matching that address.<br />

v Two-address subcommands select those input line ranges starting with a match<br />

on the first address up to an input line matching the second address, inclusive.<br />

If the second address is a number less than or equal to the line number first<br />

selected, only one line is selected.<br />

Permissible addressing constructions are:<br />

n The number n matches only the nth input line.<br />

$ This address matches the last input line.<br />

/regexp/<br />

This address selects an input line matching the specified regular expression<br />

regexp. If you do not want to use slash (/) characters around the regular<br />

expression, use a different character (but not backslash or newline) and put<br />

a backslash (\) before the first one. For example, if you want to use % to<br />

enclose the regular expression, write \%regexp%.<br />

If an regexp is empty (that is, no pattern is specified) sed behaves as if the<br />

last regexp used in the last command applied (either as an address or as<br />

part of a substitute command) was specified.<br />

A command can be preceded by a ’!’ character, in which case the command is<br />

applied if the addresses do not select the pattern space. When the variable<br />

sed<br />

Chapter 2. Shell command descriptions 535

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

Saved successfully!

Ooh no, something went wrong!