Interpretations

Answering questions that may arise related to the meaning of portions of an IEEE standard concerning specific applications.

IEEE Standards Interpretations for IEEE Std 1003.2™-1992 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)--Part 2: Shell and Utilities

Copyright © 1996 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.

Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.

IEEE Standards Department, Copyrights and Permissions, 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA

Interpretation Request #118
Topic: awk Relevant Clauses: 2.14.4

We are requesting clarification of the following paragraph from page 167, lines 146-155: "Execution of the awk program starts by first executing the actions associated with all BEGIN patterns in the order they occur in the program. Then each file operand (or standard input if no files were specified) will be processed in turn by reading data from the file until a record separator is seen (a newline character by default), splitting the current record into fields using the current value of FS according to the rules in Regular Expressions in subclause 4.1.7.4,, evaluating each pattern in the program in order of occurrence, and executing the action associated with each patter that matches the current record." In particular, we are wondering how to interpret "the current value of FS". This has implications for the following awk command: awk '{FS="."} {print $1}' awkfile where awkfile contains: a.b.c d.e.f Historical implementations print: a Does the standard require the following output? a.b.c

Interpretation Response
This request is substantially identical to interpretation #80, but it points out a case where the user can see the difference between lazy splitting and when it takes effect. As with interpretation #80, the standard clearly states the effects expected from awk, and conforming implementations must conform to this, even if it does not match some historic practices. However, concerns have been raised about this which are being forwarded to the sponsor.

Rationale for Interpretation
None.