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.

Caution<br />

Localization<br />

Exit Values<br />

Portability<br />

s String.<br />

u Unsigned decimal integer.<br />

x,X Unsigned hexadecimal integer.<br />

When there are more arguments than positions in format, the format string is<br />

applied again to the remaining arguments. When there are fewer arguments than<br />

there are positions in the format string, printf fills the remaining positions with null<br />

strings (character fields) or zeros (numeric fields).<br />

The P<strong>OS</strong>IX.2 printf facility (like the C language printf() on which it is based), does<br />

not accommodate doublebyte characters gracefully when using %c conversion, or<br />

either of %b or %s conversions with a specified precision. Use these features<br />

cautiously when you have doublebyte characters in the character set.<br />

In a doublebyte environment, normal backslash-escape characters are handled<br />

correctly—printf shifts state as required—but octal and hexadecimal escape<br />

characters do not change state. This is significant in a shift-lock environment. For<br />

example, if an octal escape character contains the shift-in character, it is the user’s<br />

responsibility to ensure that there is also a shift-out character. Further, an octal or<br />

hexadecimal backslash escape character that comes immediately after a<br />

doublebyte character may or may not be processed in the shifted state.<br />

For more information on doublebyte character environments, see “Using the<br />

doublebyte character set (DBCS)” on page 7.<br />

printf uses the following localization environment variables:<br />

v LANG<br />

v LC_ALL<br />

v LC_CTYPE<br />

v LC_MESSAGES<br />

v LC_NUMERIC<br />

v LC_SYNTAX<br />

v NLSPATH<br />

See Appendix F for more information.<br />

0 Successful completion<br />

>0 The number of failures due to any of the following:<br />

v Missing format specifications<br />

v Arguments supplied for a format string that does not accept them (that is,<br />

that has no %s)<br />

v Incorrect integer argument<br />

v Incorrect floating-point argument<br />

P<strong>OS</strong>IX.2, X/Open Portability Guide, <strong>UNIX</strong> <strong>System</strong> V.<br />

The %F format and the handling of * as a width or precision argument are<br />

extensions of the P<strong>OS</strong>IX standard.<br />

printf<br />

Chapter 2. Shell command descriptions 515

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

Saved successfully!

Ooh no, something went wrong!