From 64d63f8fd06e5370694f760093c69cdc69652447 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 11 Aug 2021 01:34:55 +0000 Subject: Add case (yet untested) Signed-off-by: Laurent Bercot --- doc/case.html | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 doc/case.html (limited to 'doc/case.html') diff --git a/doc/case.html b/doc/case.html new file mode 100644 index 0000000..5340c07 --- /dev/null +++ b/doc/case.html @@ -0,0 +1,93 @@ + + + + + + execline: the case command + + + + + + +

+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. +

+ + + -- cgit v1.3.1