Estratto del documento

Printf utility

Overview

The Single UNIX Specification, Version 2
© 1997 The Open Group

Name

printf - write formatted output

Synopsis

printf format [argument...]

Description

The printf utility will write formatted operands to the standard output. The argument operands will be formatted under control of the format operand.

Options

None.

Operands

  • format: A string describing the format to use to write the remaining operands; see the extended description section.
  • argument: The strings to be written to standard output, under the control of format; see the extended description section.

Standard Input

Not used.

Input Files

None.

Environment Variables

The following environment variables affect the execution of printf:

  • LANG: Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
  • LC_ALL: If set to a non-empty string value, override the values of all the other internationalisation variables.
  • LC_CTYPE: Determine the locale for the interpretation of sequences of bytes of text data as characters (e.g., single- vs. multi-byte characters in arguments).
  • LC_MESSAGES: Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
  • LC_NUMERIC: Determine the locale for numeric formatting. It will affect the format of numbers written using the e, E, f, g, and G conversion characters (if supported).
  • NLSPATH: Determine the location of message catalogues for the processing of LC_MESSAGES.

Asynchronous Events

Default.

Standard Output

See the extended description section.

Standard Error

Used only for diagnostic messages.

Output Files

None.

Extended Description

The format operand will be used as the format string described in the specification, XBD File, with the following exceptions:

  • Format Notation: A character in the format string, in any context other than a flag of a conversion specification, will be treated as an ordinary character that is copied to the output.
  • In addition to the escape sequences shown in the specification, XBD File Format (\\, \\a, \\b, \\f, \\n, \\r, \\t, \\v), where \\ddd is a one-, two- or three-digit octal number, will be written as a byte with the numeric value specified by the octal number.
  • The implementation will not precede or follow output from the d or u conversion specifications with blank characters not specified by the format operand.
Anteprima
Vedrai una selezione di 3 pagine su 6
Sistemi operativi - Syscall printf Pag. 1 Sistemi operativi - Syscall printf Pag. 2
Anteprima di 3 pagg. su 6.
Scarica il documento per vederlo tutto.
Sistemi operativi - Syscall printf Pag. 6
1 su 6
D/illustrazione/soddisfatti o rimborsati
Acquista con carta o PayPal
Scarica i documenti tutte le volte che vuoi
Dettagli
SSD
Scienze matematiche e informatiche INF/01 Informatica

I contenuti di questa pagina costituiscono rielaborazioni personali del Publisher N. A. di informazioni apprese con la frequenza delle lezioni di Sistemi operativi e studio autonomo di eventuali libri di riferimento in preparazione dell'esame finale o della tesi. Non devono intendersi come materiale ufficiale dell'università Università degli studi di Napoli Federico II o del prof Cotroneo Domenico.
Appunti correlati Invia appunti e guadagna

Domande e risposte

Hai bisogno di aiuto?
Chiedi alla community