A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=375 ====================================================================== Reported By: dwheeler Assigned To: ajosey ====================================================================== Project: 1003.1(2008)/Issue 7 Issue ID: 375 Category: Shell and Utilities Type: Enhancement Request Severity: Objection Priority: normal Status: Under Review Name: David A. Wheeler Organization: User Reference: Section: test Page Number: 3224-3225 Line Number: 107503-107513 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2011-02-07 18:34 UTC Last Modified: 2016-09-23 04:17 UTC ====================================================================== Summary: Extend test/[...] conditionals: ==, <, >, -nt, -ot, -ef ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- has duplicate 0000762 Add "==" as synonym for "... related to 0000813 Utility numeric argument syntax require... ======================================================================
---------------------------------------------------------------------- (0003391) shware_systems (reporter) - 2016-09-23 04:17 http://austingroupbugs.net/view.php?id=375#c3391 ---------------------------------------------------------------------- "foo|bar" after quote removal effectively gets passed to regcomp() as the C string foo|bar\0. A shell can use an internal workalike function that includes the effect of regexec()/free() too. That is what is expected to handle the extended_reg_exp production, not the code that handles shell operators. The result is then the same for re="foo|bar" [[ $str =~ $re ]] or even =~ `printf %s%s%s foo '|' bar`. The concerns you have apply if the ERE was an argument to [[ as a utility, as then the simple_command production governs interpretation, but as a keyword pair with its own productions those constraints don't hold. The locale's charmap determines the bit patterns of each code point. So the shell is dependant on them for determining whether a byte is a defined char and which class it is. Hardcoding a reliance on the C locale's charmap may fail, as a result, if the charmap of a locale says the TAB code point is represented by 0xFF instead. This is a separate issue from what code points are required to be in each charclass for all locales. For a script to be portable unquoted input with grammatical significance in terms of being token delimiters is limited to these code points. Relying on code points a locale may add to a class means the script can not function properly on a platform that doesn't provide localedef or a locale with the same additions, so to me is undefined behavior. This does not limit scripts to using only the POSIX locale, but it is a subset of the locales scripts that don't care about portability might use. Issue History Date Modified Username Field Change ====================================================================== 2011-02-07 18:34 dwheeler New Issue 2011-02-07 18:34 dwheeler Status New => Under Review 2011-02-07 18:34 dwheeler Assigned To => ajosey 2011-02-07 18:34 dwheeler Name => David A. Wheeler 2011-02-07 18:34 dwheeler Section => test 2011-02-07 18:34 dwheeler Page Number => 3224-3225 2011-02-07 18:34 dwheeler Line Number => 107503-107513 2011-02-07 18:49 dwheeler Note Added: 0000666 2011-02-07 20:23 Don Cragun Interp Status => --- 2011-02-07 20:23 Don Cragun Note Added: 0000667 2011-02-07 20:23 Don Cragun Severity Editorial => Objection 2011-02-07 20:23 Don Cragun Type Clarification Requested => Enhancement Request 2011-02-07 21:56 dwheeler Note Added: 0000668 2011-02-07 22:20 Don Cragun Description Updated 2011-02-07 22:20 Don Cragun Desired Action Updated 2011-02-07 22:22 Don Cragun Note Edited: 0000667 2011-02-07 22:50 dwheeler Note Added: 0000669 2011-02-07 23:13 eblake Note Added: 0000670 2011-03-08 03:15 dwheeler Note Added: 0000688 2011-04-24 13:16 jsonn Note Added: 0000754 2011-04-24 19:01 dwheeler Note Added: 0000755 2011-04-24 21:48 jsonn Note Added: 0000756 2011-04-25 20:45 dwheeler Note Added: 0000758 2011-04-26 09:25 markh Note Added: 0000759 2011-04-26 09:57 wpollock Note Added: 0000760 2011-04-26 10:36 jsonn Note Added: 0000761 2011-09-22 08:59 ajosey Note Added: 0000967 2011-09-25 00:36 dwheeler Note Added: 0000974 2011-09-25 18:51 gber Note Added: 0000975 2011-09-28 07:09 olof Issue Monitored: olof 2011-11-15 17:26 dwheeler Note Added: 0001011 2011-11-15 19:25 ajosey File Added: Extendingshellconditionals.pdf 2011-11-15 19:27 ajosey File Added: Extendingshellconditionals.txt 2011-11-15 19:30 ajosey Note Added: 0001013 2011-11-23 23:49 dwheeler File Added: Extendingshellconditionals-2011-11-23.pdf 2011-11-23 23:50 dwheeler File Added: Extendingshellconditionals-2011-11-23.odt 2011-11-23 23:50 dwheeler File Added: Extendingshellconditionals-2011-11-23.txt 2011-11-23 23:57 dwheeler Note Added: 0001044 2011-11-28 15:50 geoffclare Note Added: 0001060 2011-11-28 15:51 geoffclare File Added: Extendingshellconditionals-2011-11-28.odt 2011-11-28 15:52 geoffclare File Added: Extendingshellconditionals-2011-11-28.pdf 2011-11-28 16:10 geoffclare Note Edited: 0001060 2011-11-28 16:38 dwheeler Note Added: 0001061 2011-11-29 03:26 Roger Marquis Note Added: 0001064 2011-11-29 03:27 Roger Marquis Note Edited: 0001064 2011-11-29 04:51 dwheeler Note Added: 0001065 2011-12-29 19:01 antoinel Issue Monitored: antoinel 2013-10-10 01:15 dwheeler Note Added: 0001869 2013-10-12 04:08 dwheeler Note Added: 0001881 2013-10-24 15:15 geoffclare File Added: Extendingshellconditionals-2013-10-24.odt 2013-10-24 15:16 geoffclare File Added: Extendingshellconditionals-2013-10-24.pdf 2013-10-24 15:23 geoffclare Note Added: 0001944 2013-10-25 10:26 geoffclare Note Added: 0001945 2013-10-31 15:55 Don Cragun Relationship added has duplicate 0000762 2013-11-01 15:36 ranjit Note Added: 0001950 2013-11-01 19:09 dwheeler Note Added: 0001953 2013-11-01 19:43 shware_systems Note Added: 0001954 2013-11-10 14:46 dwheeler Note Added: 0001979 2013-11-22 22:13 dwheeler Note Added: 0002017 2013-11-29 18:56 dwheeler File Added: Extendingshellconditionals-2013-11-29.odt 2013-11-29 18:57 dwheeler File Added: Extendingshellconditionals-2013-11-29-track-changes.pdf 2013-11-29 18:58 dwheeler File Added: Extendingshellconditionals-2013-11-29.pdf 2013-11-29 19:11 dwheeler Note Added: 0002031 2013-11-29 19:24 dwheeler Note Added: 0002032 2013-12-01 22:52 jilles Note Added: 0002033 2013-12-02 08:59 shware_systems Note Added: 0002034 2013-12-02 11:15 shware_systems Note Added: 0002035 2013-12-08 22:06 dwheeler Note Added: 0002052 2013-12-08 22:48 dwheeler Note Added: 0002053 2013-12-08 23:05 dwheeler Note Added: 0002054 2013-12-09 01:32 dwheeler File Added: Extendingshellconditionals-2013-12-08.odt 2013-12-09 01:33 dwheeler File Added: Extendingshellconditionals-2013-12-08.pdf 2013-12-09 01:35 dwheeler Note Added: 0002055 2013-12-09 06:55 shware_systems Note Added: 0002056 2013-12-10 04:46 dwheeler Note Added: 0002059 2013-12-10 04:52 dwheeler File Added: Extendingshellconditionals-2013-12-09.odt 2013-12-10 04:53 dwheeler File Added: Extendingshellconditionals-2013-12-09.pdf 2013-12-10 09:41 shware_systems Note Added: 0002060 2013-12-10 16:08 dwheeler Note Added: 0002061 2013-12-10 22:36 jilles Note Added: 0002063 2013-12-11 00:46 dwheeler Note Added: 0002064 2013-12-11 00:48 shware_systems Note Added: 0002065 2013-12-11 00:58 dwheeler Note Added: 0002066 2013-12-12 01:38 shware_systems Note Added: 0002068 2013-12-12 06:04 shware_systems Note Edited: 0002068 2014-03-06 17:08 eblake Relationship added related to 0000813 2014-03-06 17:15 geoffclare Note Added: 0002176 2014-03-06 19:13 ranjit Note Added: 0002177 2014-03-06 21:22 shware_systems Note Added: 0002178 2014-03-07 15:46 dwheeler Note Added: 0002179 2014-03-07 15:52 dwheeler Note Added: 0002180 2014-03-11 14:52 shware_systems Note Added: 0002181 2014-03-12 23:05 dwheeler Note Added: 0002182 2014-03-14 13:25 ranjit Note Added: 0002186 2014-10-13 16:44 rhansen Note Added: 0002418 2014-10-13 16:52 geoffclare Note Added: 0002419 2014-10-13 16:55 dwheeler Note Added: 0002420 2014-10-13 17:54 rhansen Note Added: 0002421 2016-09-19 21:46 stephane Note Added: 0003382 2016-09-20 17:16 shware_systems Note Added: 0003383 2016-09-20 20:34 stephane Note Added: 0003384 2016-09-20 21:03 stephane Note Added: 0003385 2016-09-20 21:07 stephane Note Edited: 0003385 2016-09-21 07:35 shware_systems Note Added: 0003386 2016-09-21 10:20 stephane Note Added: 0003387 2016-09-21 22:44 shware_systems Note Added: 0003388 2016-09-22 08:42 stephane Note Added: 0003389 2016-09-22 08:59 stephane Note Added: 0003390 2016-09-23 04:17 shware_systems Note Added: 0003391 ======================================================================