[beast/temp-rc1] mkrelease.sh: add helper function match() for string pattern matches



commit 30eff5eb161e00b30ed1525d3ed91f1e9dbe3585
Author: Tim Janik <timj gnu org>
Date:   Sun Jul 28 19:38:19 2013 +0200

    mkrelease.sh: add helper function match() for string pattern matches

 mkrelease.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/mkrelease.sh b/mkrelease.sh
index 516b0ff..dcb0aa8 100755
--- a/mkrelease.sh
+++ b/mkrelease.sh
@@ -28,6 +28,14 @@ die() {
   exit $estatus
 }
 unset R_REVISION
+function match() {     # perform wildcard string match: match "*.*" unmatched1 foo.dat unmatched2...
+  pattern="$1" ; searchtext="$2"
+  case "$searchtext" in
+    $pattern) return 0 ;; # $pattern must be unquoted to allow *?[]
+  esac
+  return 1
+}
+
 
 # === Usage ===
 usage() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]