WG15 Defect Report Ref: 9945-2-126
Topic: find <dirname> -name "?X" -print


This is an approved interpretation of 9945-2:1993.

.

Last update: 1997-05-20


								9945-2-126

 _____________________________________________________________________________

	Topic:                  find <dirname> -name "?X" -print
	Relevant Sections:      4.24.4 and 3.13

Defect Report:
-----------------------

	From: mark@mks.com (Mark Funkenhauser)
	Date: Thu, 1 Jun 1995 12:31:00 -0400 (EDT)


Dear Standards Board,

    I would like to an request official, binding interpretation
    from WG15 concerning the following point in ISO/IEC
    9945-2:1993 (POSIX.2).

    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 subsections:
      3.13.1 Patterns Matching a Single Character
      3.13.2 Patterns Matching Multiple Characters
      3.13.3 Patterns Used for Filename Expansion
    
    Sections 3.13.1 and 3.13.2 seem to describe the pattern
    matching notation and section 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 sections 3.13.1 and 3.13.2 the only sections relevant to 
      "pattern matching notation" or is section 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 section 3.13.3 is relevant to find, then the answer becomes no.
     

    Thank you for your attention to this matter.

    Mark Funkenhauser


Interpretation response
------------------------

Section 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, section 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
-------------
None.

Forwarded to Interpretations group: Jun 20 1995
Proposed resolution forwarded: Aug 11 1995
Finalized: Sept 12 1995