I have a rather long case statement (about 150 patterns to match). case $line in  pattern1) ret=result1;;  pattern2) ret=result2;;  pattern3) ret=result3;;   ...   ...esacHowever, this is not really appropriate as the patterns are really user modifiable data .. So everytime a new pattern is needed, I need to go into and modify the case statement.What i would like to do is create a separate text file something like:pattern1=result1pattern2=result2pattern3=result3......The text file would be read and used to create the case statement.  This has the advantage of not needing to modify the code every time a new pattern is required.Is there a way to automatically create a case statement from input from a text file?  I'm open to other options, but am looking for a solution that can do the pattern matching to the input line very fast as I also have a large number of input lines to match against.
dynamic case statement creation
bash;shell script