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

Re: strange bash problem on potato

On Wed, 7 Apr 1999, Ulf Jaenicke-Roessler wrote:

> Dale Scheetz wrote:
> > On inspection of your script, I see that 'case i in' is not what you
> > meant. This line should be 'case $i in' and you will get the results you
> > are expecting.
> Yes, this is an error in the demonstration script. Besides, the script was
> too simple. It doesn't show the bug I was trying to explain.
> Nevertheless, is "case i in" formally correct, or why didn't bash complain
> about a syntax error???

Because there is no syntax error. The statement simply asks if the
character "i" appears in any of your case comparisons. This is why the
[A-H] condition failed, but the [A-K] condition succeeded (as i is in the
range A-K).

Both sytax are correct, they only mean different values when parsed by


_-_-_-_-_-   Author of "The Debian Linux User's Guide"  _-_-_-_-_-_-

aka   Dale Scheetz                   Phone:   1 (850) 656-9769
      Flexible Software              11000 McCrackin Road
      e-mail:  dwarf@polaris.net     Tallahassee, FL  32308

_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-

Reply to: