[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
One of the most common programming actions is to print or output,
some or all of the input. Use the print
statement
for simple output, and the printf
statement
for fancier formatting.
The print
statement is not limited when
computing which values to print. However, with two exceptions,
you cannot specify how to print them--how many
columns, whether to use exponential notation or not, and so on.
(For the exceptions, see section 5.3 Output Separators, and
Controlling Numeric Output with print
.)
For that, you need the printf
statement
(see section Using printf
Statements for Fancier Printing).
Besides basic and formatted printing, this chapter
also covers I/O redirections to files and pipes, introduces
the special file names that gawk
processes internally,
and discusses the close
built-in function.
5.1 The The 5.2 Examples of Simple examples of 5.3 Output Separators The output separators and how to change them. 5.4 Controlling Numeric Output with Controlling Numeric Output With 5.5 Using printf
Statements for Fancier PrintingThe printf
statement.5.6 Redirecting Output of printf
How to redirect output to multiple files and pipes. 5.7 Special File Names in gawk
File name interpretation in gawk
.gawk
allows access to inherited file
descriptors.
5.8 Closing Input and Output Redirections Closing Input and Output Files and Pipes.