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 #126
Topic: find -name "?X" -print Relevant Clauses: 4.24.4 and 3.13

I would like a clarification of lines 4297-4299 (page 281) which state: 4297 ... if the basename of the 4298 filename being examined matches 'pattern;' using the pattern 4299 matching notation described in 3.13. Looking at 3.13, there are 3 subclauses: 3.13.1 Patterns Matching a Single Character 3.13.2 Patterns Matching Multiple Characters 3.13.3 Patterns Used for Filename Expansion Subclauses 3.13.1 and 3.13.2 seem to describe the pattern matching notation and subclause 3.13.3 qualifies the rules in 3.13.1 and 3.13.2 when used for filename expansion. The question: With respect to find and line 4297-4299, are subclauses 3.13.1 and 3.13.2 the only subclauses relevant to "pattern matching notation" or is subclause 3.13.3 relevant also? Specifically, 3.13.3(2) describes qualifications that pertain to filenames that begin with the '.' character and whether it can be matched by the asterisk, question mark characters or bracket expressions. For instance, will either of find . -name ?X -print find . -name [[:punct:]]X -print find the filename ./.X ? Historically the answer has been yes. But if subclause 3.13.3 is relevant to find, then the answer becomes no.

Interpretation Response
Subclause 3.13.3 is only used when pattern matching notion is used for filename expansion. In the case of find; filename expansion is not being performed. A known filename is being matched against a pattern, therefore, subclause 3.13.3 does not apply. The standard clearly states the behavior of pattern matching in file, and conforming implementations must conform to this.

Rationale for Interpretation