How to replace any one of many possible matches in bash

I want to reduce this down to one line:


Here is a test sample. User chooses one of the following from a shell menu and their choice is passed into bash script code above (so, only need to match ONE of the possibilities):

Is it possible?

I tried something like:


But it didn't work.


I think this is what you are looking for.

shopt -s extglob

The pattern @(a|b|c) matches any one of the patterns a, b, or c. Note the need to escape the ?, as it is a wildcard that matches any single character in a pattern.

Need Your Help

Returning an Updated Row in Integration Test C#

c# sql sql-server stored-procedures

In my code I originally have a test method that disable a row by calling a stored procedure. My stored procedure updates the disable column if the value changed from the previous value in the datab...

Executing long command with groovy on linux shell?

linux bash shell groovy sh

How can I execute a long command with groovy?