A NOTE has been added to this issue. 
====================================================================== 
https://www.austingroupbugs.net/view.php?id=1951 
====================================================================== 
Reported By:                Love4Boobies
Assigned To:                
====================================================================== 
Project:                    1003.1(2024)/Issue8
Issue ID:                   1951
Category:                   Shell and Utilities
Type:                       Error
Severity:                   Editorial
Priority:                   normal
Status:                     New
Name:                       Bogdan Barbu 
Organization:                
User Reference:              
Section:                    getopts, EXAMPLES section 
Page Number:               
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/getopts.html 
Line Number:                Idk, I used the web version 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2025-10-25 21:48 UTC
Last Modified:              2025-10-30 16:58 UTC
====================================================================== 
Summary:                    getopts example oversight
====================================================================== 

---------------------------------------------------------------------- 
 (0007301) geoffclare (manager) - 2025-10-30 16:58
 https://www.austingroupbugs.net/view.php?id=1951#c7301 
---------------------------------------------------------------------- 
It seems likely to me that not escaping the ? is intentional.  In a script with
a large number of options, if there is a mismatch between the list passed to
getopts and the list handled in the case statement, it is desirable for an
unexpected value of "name" to be reported as a usage error rather than falling
through the case statement unhandled.

My suggestion is to change the ? to * so that it is clear this is a catch-all
(even though it should always be one character). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2025-10-25 21:48 Love4Boobies   New Issue                                    
2025-10-30 16:58 geoffclare     Note Added: 0007301                          
======================================================================


  • [1003.1(20... Austin Group Issue Tracker via austin-group-l at The Open Group
    • [1003... Austin Group Issue Tracker via austin-group-l at The Open Group
    • [1003... Austin Group Issue Tracker via austin-group-l at The Open Group

Reply via email to