A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1031 ====================================================================== Reported By: dannyniu Assigned To: ====================================================================== Project: 1003.1(2013)/Issue7+TC1 Issue ID: 1031 Category: Shell and Utilities Type: Enhancement Request Severity: Editorial Priority: normal Status: New Name: DannyNiu/NJF Organization: User Reference: Section: The 'find' utility. Page Number: 2761-2770 Line Number: 90443-90860 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2016-03-07 03:21 UTC Last Modified: 2017-02-16 16:33 UTC ====================================================================== Summary: Add -iname (case-insensitive name search) to the find utility. ======================================================================
---------------------------------------------------------------------- (0003559) geoffclare (manager) - 2017-02-16 16:33 http://austingroupbugs.net/view.php?id=1031#c3559 ---------------------------------------------------------------------- (2016 edition page and line numbers) On page 107 before line 2926 (XBD chapter 4 General Concepts), insert a new section: <blockquote>4.1 Case Insensitive Comparisons When a standard utility or function that uses regular expressions or pattern matching specifies that matching shall be case insensitive, then if a string would match the regular expression or pattern when doing a case-sensitive match, the same string with any of its characters replaced with their case counterparts, as defined by the <b>toupper</b> and <b>tolower</b> character mappings (see [xref to XBD 7.3.1]), shall also match when doing a case-insensitive match. This definition of case-insensitive processing is intended to allow matching of multi-character collating elements as well as characters, as each character in the string is matched using both its cases. For example, in a locale with a "Ch" multi-character collating element (see [xref to XBD 7.3.2 bullet 1]), the bracket expression <tt>"[[.Ch.]]"</tt> (see [xref to XBD 9.3.5 bullet 4]) matches the strings <tt>"ch"</tt>, <tt>"Ch"</tt>, <tt>"cH"</tt>, and <tt>"CH"</tt> when matching without regard to case.</blockquote>and renumber the following sections. On page 182 line 6030 (XBD 9.2) change:<blockquote>When a standard utility or function that uses regular expressions specifies that pattern matching shall be performed without regard to the case (uppercase or lowercase) of either data or patterns, then when each character in the string is matched against the pattern, not only the character, but also its case counterpart (if any), shall be matched. This definition of case-insensitive processing is intended to allow matching of multi-character collating elements as well as characters, as each character in the string is matched using both its cases. For example, in a locale where "Ch" is a multi-character collating element and where a matching list expression matches such elements, the RE "<tt>[[.Ch.]]</tt>" when matched against the string "<tt>char</tt>" is in reality matched against "<tt>ch</tt>", "<tt>Ch</tt>", "<tt>cH</tt>", and "<tt>CH</tt>".</blockquote>to:<blockquote>Some standard utilities and functions support case-insensitive regular expression matching. When this type of matching is in effect, the matching process shall be modified as described in [xref to XBD 4.1].</blockquote> On page 2797 after line 91930 (XCU section find operands) add a new item:<blockquote><b>-iname</b> <i>pattern</i><blockquote>The <b>-iname</b> primary shall be equivalent to <b>-name</b>, except that the match shall be case insensitive. See [xref to XBD 4.1].</blockquote></blockquote> On page 2800 line 92074 (XCU section find (LC_COLLATE)), change:<blockquote>used in the pattern matching notation for the <b>-n</b> option</blockquote>to:<blockquote>used in the pattern matching notation for the <b>-name</b>, <b>-iname</b> and <b>-path</b> primaries</blockquote> On page 2800 line 92079 (XCU section find (LC_CTYPE)), change:<blockquote>within the pattern matching notation used for the <b>-n</b> option</blockquote>to:<blockquote>within the pattern matching notation used for the <b>-name</b>, <b>-iname</b> and <b>-path</b> primaries</blockquote> On page 2843 line 93633 (XCU section grep), change:<blockquote>Perform pattern matching in searches without regard to case;</blockquote>to:<blockquote>Perform pattern matching in a case-insensitive manner;</blockquote> On page 3005 line 99882 (XCU more), change:<blockquote>Perform pattern matching in searches without regard to case;</blockquote>to:<blockquote>Perform pattern matching in a case-insensitive manner;</blockquote> Cross-volume changes to XBD ... On page 254 after line 8520 (XBD section <fnmatch.h>), add the following new items:<blockquote>FNM_CASEFOLD <i>string</i> and <i>pattern</i> are compared in a case-insensitive manner. See [xref to XBD 4.1]. FNM_IGNORECASE Equivalent to FNM_CASEFOLD.</blockquote> On page 323 line 10972 (XBD section <regex.h>), change:<blockquote>Ignore case in match</blockquote>to:<blockquote>Perform pattern matching in a case-insensitive manner</blockquote> Cross-volume changes to XSH ... On page 890 after line 30073 (XSH section fnmatch()), add a new paragraph:<blockquote>If FNM_CASEFOLD or FNM_IGNORECASE is set, <i>string</i> and <i>pattern</i> shall be compared in a case-insensitive manner. See [xref to XBD 4.1].</blockquote> On page 1802 line 58345 (XSH section regcomp()), change:<blockquote>Ignore case in match (see [xref to XBD Chapter 9])</blockquote>to:<blockquote>Perform matching in a case-insensitive manner (see [xref to XBD 9.2])</blockquote> Cross-volume changes to XRAT ... On page 3511 line 118810 (XRAT A.4), insert a new section:<blockquote>A.4.1 Case Insensitive Comparisons Case-insensitive matching is defined in this standard in terms of a simple algorithm whereby, for each character in the string to be matched, if the character is uppercase then the lowercase equivalent (if any) is also checked for a match, and if the character is lowercase then the uppercase equivalent (if any) is also checked for a match. It is described this way to make the expected behavior easier to understand; however, implementations may internally use more sophisticated algorithms to improve efficiency, provided that the result is the same as the simple algorithm would produce.</blockquote> and renumber the following A.4.x sections. Issue History Date Modified Username Field Change ====================================================================== 2016-03-07 03:21 dannyniu New Issue 2016-03-07 03:21 dannyniu Name => DannyNiu/NJF 2016-03-07 03:21 dannyniu Section => The 'find' utility. 2016-03-07 03:21 dannyniu Page Number => 2761-2770 2016-03-07 03:21 dannyniu Line Number => 90443-90860 2016-03-07 12:09 stephane Note Added: 0003090 2016-03-07 12:53 schwarze Note Added: 0003091 2017-02-16 16:33 geoffclare Note Added: 0003559 ======================================================================