*Synopsis*: "getopts" function does not work as expect.

CR 6819961 changed on Aug 31 2009 by <User 1-1SURPB>

=== Field ============ === New Value ============= === Old Value =============

Status                 3-Accepted                  1-Dispatched               
====================== =========================== ===========================

     
*Change Request ID*: 6819961

*Synopsis*: "getopts" function does not work as expect.

  Product: solaris
  Category: shell
  Subcategory: korn93
  Type: Defect
  Subtype: 
  Status: 3-Accepted
  Substatus: 
  Priority: 3-Medium
  Introduced In Release: 
  Introduced In Build: 
  Responsible Engineer: 
  Keywords: 

=== *Description* ============================================================
# ksh --version
  version         sh (AT&T Research) 93t 2008-11-04

Given following scripts, we do not expect command "(( OPTIND = ${OPTIND} + 1 
))" to be excuted, but when run the scripts with ksh93, the command will be 
executed.

########################
### Start of scripts
#! /usr/bin/ksh

function modify_target_param
{
        usage=":"
        usage="${usage}B:(bi-directional-authentication)"

        while getopts "${usage}" option
        do
                case ${option} in
                "B")
                        bi="${OPTARG}"
                        ;;
                "?")
                        (( OPTIND = ${OPTIND} + 1 ))
                        ;;
                esac
        done
}

modify_target_param -B enable target

### End of scripts
#####################################

*** (#1 of 1): 2009-03-20 06:17:26 GMT+00:00 <User 1-6T7YJ1>


=== *Public Comments* ========================================================

=== *Workaround* =============================================================

=== *Additional Details* =====================================================
        Targeted Release: 
        Commit To Fix In Build: 
        Fixed In Build: 
        Integrated In Build: 
        Verified In Build: 
  See Also: 
  Duplicate of: 
  Hooks:
        Hook1: 
        Hook2: 
        Hook3: 
        Hook4: 
        Hook5: 
        Hook6: 
  Program Management: 
  Root Cause: 
  Fix Affects Documentation: No
  Fix Affects Localization: No

=== *History* ================================================================
        Date Submitted: 2009-03-20 06:17:25 GMT+00:00
        Submitted By: <User 1-6T7YJ1>

        Status Changed    Date Updated                  Updated By
        3-Accepted        2009-08-31 09:36:42 GMT+00:00 <User 1-1SURPB>


=== *Service Request* ========================================================
        Impact: Significant
        Functionality: Secondary
        Severity: 3
        Product Name: solaris
        Product Release: solaris_nevada
        Product Build: 
        Operating System: solaris_nevada
        Hardware: x86
        Submitted Date: 2009-03-20 06:17:26 GMT+00:00


=== *Multiple Release (MR) Cluster* - 0 ======================================

Reply via email to