The Open Group Base Specifications Issue 6
IEEE Std 1003.1, 2003 Edition
Copyright © 2001-2003 The IEEE and The Open Group

File Format Notation

The notation for spaces allows some flexibility for application output. Note that an empty character position in format represents one or more <blank>s on the output (not white space, which can include <newline>s). Therefore, another utility that reads that output as its input must be prepared to parse the data using scanf(), awk, and so on. The '' character is used when exactly one <space> is output.

The treatment of integers and spaces is different from the printf() function in that they can be surrounded with <blank>s. This was done so that, given a format such as:

"%d\n",<foo>

the implementation could use a printf() call such as:

printf("%6d\n", foo);

and still conform. This notation is thus somewhat like scanf() in addition to printf().

The printf() function was chosen as a model because most of the standard developers were familiar with it. One difference from the C function printf() is that the l and h conversion specifier characters are not used. As expressed by the Shell and Utilities volume of IEEE Std 1003.1-2001, there is no differentiation between decimal values for type int, type long, or type short. The conversion specifications %d or %i should be interpreted as an arbitrary length sequence of digits. Also, no distinction is made between single precision and double precision numbers ( float or double in C). These are simply referred to as floating-point numbers.

Many of the output descriptions in the Shell and Utilities volume of IEEE Std 1003.1-2001 use the term ``line'', such as:

"%s", <input line>

Since the definition of line includes the trailing <newline> already, there is no need to include a '\n' in the format; a double <newline> would otherwise result.


UNIX ® is a registered Trademark of The Open Group.
POSIX ® is a registered Trademark of The IEEE.
[ Main Index | XBD | XCU | XSH | XRAT ]