execline
Software
skarnet.org

The case program

case compares a value against a series of regular expressions, and executes into a program depending on the first expression the value matches.

Interface

In an execlineb script:

     case [ -E | -e | -i | -n ] value
     {
       [ regex { prog... } ]
       [ regex { prog... } ]
       ...
     }
     progdefault...

Options

Subexpression matching

If the -N option has been given, and value matches a regex, then case will run prog with a modified environment:

To retrieve that information into your command line in an execline script, you can use the elgetpositionals program.