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 06:59 UTC
====================================================================== 
Summary:                    Extend test/[...] conditionals: ==, <, >, -nt, -ot,
-ef
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0000762 Add &quot;==&quot; as synonym for &quot...
related to          0000813 Utility numeric argument syntax require...
====================================================================== 

---------------------------------------------------------------------- 
 (0003392) stephane (reporter) - 2016-09-23 06:59
 http://austingroupbugs.net/view.php?id=375#c3392 
---------------------------------------------------------------------- 
Re: http://austingroupbugs.net/view.php?id=375#c3391

Mark, you're missing the point I'm trying to make since the
beginning. What you're describing (about quoting of RE
operators) is the zsh/bash31 behaviour, not the one of
bash32+/ksh93 or what this proposal specifies. Quoting the
proposal:

> string =~ regex
> true if string matches the extended regular expression (ERE)
> regex as defined in section 9.4; otherwise false.  Characters
> that are quoted in regex (using <backslash>, single-quote, or
> double-quote) shall not be treated as an ERE special character,
> but shall instead be treated as an ERE ordinary character and
> thus only match themselves.

See also appendix B

So [[ $a =~ "foo|bar" ]] and s='foo|bar'; [[ $a =~ "$s" ]] is
testing whether $a contains "foo|bar" (as if by calling
regcomp("foo\\|bar")), [[ $a =~ foo|bar ]] is not allowed and
re='foo|bar'; [[ $a =~ $re ]] is matching $a against the foo|bar
ERE (regcomp("foo|bar")).

With  bash-4.3:

<pre>
$ ltrace -e regcomp bash -c '[[ a =~ "a|b" ]]'
bash->regcomp(0x7ffff013f3b0, "a\\|b", 1)                                  
                                          = 0
+++ exited (status 1) +++
$ ltrace -e regcomp bash -c '[[ a =~ a|b ]]'
bash->regcomp(0x7fff33a64d50, "a|b", 1)                                    
                                          = 0
+++ exited (status 0) +++
$ ltrace -e regcomp bash -c 're="a|b"; [[ a =~ "$re" ]]'
bash->regcomp(0x7fffba6ec710, "a\\|b", 1)                                  
                                          = 0
+++ exited (status 1) +++
$ ltrace -e regcomp bash -c 're="a|b"; [[ a =~ $re ]]'
bash->regcomp(0x7ffe497b2700, "a|b", 1)                                    
                                          = 0
+++ exited (status 0) +++
$ ltrace -e regcomp bash -c '[[ a =~ ["a|b"] ]]'
bash->regcomp(0x7ffe32decc20, "[a|b]", 1)                                  
                                          = 0
+++ exited (status 0) +++
$ ltrace -e regcomp bash -c '[[ a =~ "[a|b]" ]]'
bash->regcomp(0x7ffea326a1e0, "\\[a\\|b]", 1)                              
                                          = 0
+++ exited (status 1) +++
</pre>

With zsh-5.1.1

<pre>
$ ltrace -e regcomp zsh -c '[[ a =~ "a|b" ]]'
regex.so->regcomp(0x7ffc3aaa2ac0, "a|b", 1)                                
                                          = 0
+++ exited (status 0) +++
$ ltrace -e regcomp zsh -c '[[ a =~ a|b ]]'
zsh:1: parse error near `|'
+++ exited (status 1) +++
</pre> 

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                          
2016-09-23 06:59 stephane       Note Added: 0003392                          
======================================================================


Reply via email to