Bash Help

I have ksh script and converting to bash . This portion is failing .

code in ksh:

read choice
        until [[ $tries -gt 2 || $choice = +([0-9]) && $choice -gt 0 \
                && choice -le "${#rdbms[*]}" ]]; do
                print -n "Invalid choice - must enter number between 1"
                print -n " and ${#rdbms[*]}: "
                read choice
                let tries=tries+1
        done

and when I run this under bash shell , it's giving the error as :

line 235: syntax error in conditional expression: unexpected token `('
line 235: syntax error near `+(['
line 235: `        until [[ $tries -gt 2 || $choice = +([0-9]) && $choice -gt 0 \'

any help with this ...

Thanks

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

remove "(" and ")" in "+([0-9])"
also you might want to replace print command by echo

Hi.
I suggest experimenting with bash builtin shopt:

       If the extglob shell option is enabled using the shopt builtin, several
       extended pattern matching operators are recognized.  In  the  following
       description, a pattern-list is a list of one or more patterns separated
       by a |.  Composite patterns may be formed using one or more of the fol-
       lowing sub-patterns:

              ?(pattern-list)
                     Matches zero or one occurrence of the given patterns
              *(pattern-list)
                     Matches zero or more occurrences of the given patterns
              +(pattern-list)
                     Matches one or more occurrences of the given patterns

-- excerpt from man bash

cheers, drl

Thankyou Guys.