linux - check if the input is a vowel -


I am beginning with Bash scripting and which I have studied in other programming languages, most of them apply For bash I have to check whether the user has entered a vowel or not. I came up with this:

  #! / Bin / bash read -p "Enter something:" char if [[$ char -eq [AEIOUEiou] *]]; Then the "vowels" resonate the other "consonant" fix  

but when I run it on IdeOne, I get an error:

  Prog.sh: line 3: [[: [AiUUEUU] *: Syntax error: Operand expected (error token is "[AEUUEUU] *")  

Can anyone tell me that What is wrong here and how to improve it?

I know that many other conditions should not be cleaned together in a clean way. I am trying to avoid it.

you == operator to match this globe:

  #! / Bin / bash read -p "Enter something:" char if [["$ char" == * [AYUU]]] ;; Then the "vowel" is used to match the second "Exonontant" fix  

-a -

Test according to man :

  INTEGER1 -Ec INTEGER2 is equal to INTEGER1 INTEGER2  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -