I have a shell script script.sh like this:names=( jack john jerry)And I want the user to type any of these three names as its first parameter, just like:./script.sh jackIf the user typed a wrong one, for example./script.sh kateIt will trigger a exit and ask the user to only type one from those 3.What should I do?
How do I check if a given parameter is in an given array?
shell