bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getopts confuses lower and upper case options


From: Chet Ramey
Subject: Re: getopts confuses lower and upper case options
Date: Thu, 20 Mar 2008 14:12:24 -0400

> Machine Type: mips-sgi-irix6.5
> 
> Bash Version: 3.2
> Patch Level: 0
> Release Status: release
> 
> Description:
> ============
> scripterror (source below) is a function that 
>   puts the argument of option m in variable 'message'
>   puts the argument of option M in variable `testText'
> 
> but as you can see, if i supply both options, the argument for -M has gone 
> into the argument for -m instead:
> 
> # -bash 37 > scripterror -m messagetext -M testtext
> testItem=
> message=testtext
> Warning: in -bash: testtext

I can't reproduce this.  You might try putting an `echo $opt' before the
case statement to see what getopts is returning.  It might be that you
have the option that causes `case' to do case-insensitive matching enabled.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                                Live Strong.
Chet Ramey, ITS, CWRU    chet@case.edu    http://tiswww.tis.case.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]