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

String Options<br />

possible binary values, except for those actually specified in the string1<br />

operand) are placed in this new set in ascending order by binary value. The<br />

new set is used in place of string1.<br />

-C Complements the set of characters specified by string1. This means that tr<br />

constructs a new set and the complements of the characters specified by<br />

string1 (the set of all characters in the current character set, as defined by<br />

the current setting of LC_CTYPE, except for those actually specified in the<br />

string1 operand) are placed in this new set in ascending collation sequence,<br />

as defined by the current setting of LC_COLLATE. This behaves the same<br />

as -c when the variable _<strong>UNIX</strong>03 is unset or is not set to YES.<br />

–d Deletes input characters found in string1 from the output.<br />

–s tr checks for sequences of a string1 character repeated several consecutive<br />

times. When this happens, tr replaces the sequence of repeated characters<br />

with one occurrence of the corresponding character from string2; if string2<br />

is not specified, the sequence is replaced with one occurrence of the<br />

repeated character itself. For example:,<br />

tr –s abc xyz<br />

translates the input string aaaabccccb into the output string of xyzy.<br />

If you specify both the –d and –s options, you must specify both string1<br />

and string2. In this case, string1 contains the characters to be deleted,<br />

whereas string2 contains characters that are to have multiple consecutive<br />

appearances replaced with one appearance of the character itself. For<br />

example:<br />

tr –ds a b<br />

translates the input string abbbaaacbb into the output string bcb.<br />

The actions of the –s option take place after all other deletions and<br />

translations.<br />

You can use the following conventions to represent elements of string1 and string2:<br />

character<br />

Any character not described by the conventions that follow represents itself.<br />

\ooo An octal representation of a character with a specific coded value. It can<br />

consist of one, two, or three octal digits (01234567). Doublebyte characters<br />

require multiple, concatenated escape sequences of this type, including the<br />

leading \ for each byte.<br />

\character<br />

The \ (backslash) character is used as an escape to remove the special<br />

meaning of characters. It also introduces escape sequences for nonprinting<br />

characters, in the manner of C character constants: \b, \f, \n, \r, \t, and<br />

\v.<br />

c1–c2 In the P<strong>OS</strong>IX locale, as long as neither endpoint is an octal sequence of<br />

the form \ooo, this represents all characters between characters c1 and c2<br />

(in the current locale’s collating sequence) including the end values. For<br />

example, ’a–z’ represents all the lowercase letters in the P<strong>OS</strong>IX locale,<br />

whereas ’A–Z’ represents all that locale’s uppercase letters. One way to<br />

convert lowercase and uppercase is with the following filter:<br />

Chapter 2. Shell command descriptions 705<br />

tr

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

Saved successfully!

Ooh no, something went wrong!