gsu: Don't use the =~ operator.
authorAndre Noll <maan@systemlinux.org>
Thu, 25 Nov 2010 16:36:23 +0000 (17:36 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:39:58 +0000 (21:39 +0200)
I need it at least on one machine that still has only bash-2.

funcs/gsu

index 673605e43bbca8e66940722b7c587b72ba84964b..1d23973a46cffe85159972a6bbaae62bf1373dd3 100644 (file)
--- a/funcs/gsu
+++ b/funcs/gsu
@@ -427,7 +427,7 @@ gsu_getopts()
 
        ret=-$E_GSU_GETOPTS
        result="invalid optstring $1"
-       if [[ -z "$1" || "$1" =~ "::" ]]; then
+       if [[ -z "$1" ]] || grep -q '::' <<< "$1" ; then
                gsu_err_msg
                exit 1
        fi