From: Kefu Chai Date: Thu, 28 Mar 2019 03:57:21 +0000 (+0800) Subject: script/ceph-backport.sh: fix sanity test of issue number X-Git-Tag: v15.0.0~56^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5696085611494b0aaddd126417705277284ff7dd;p=ceph-ci.git script/ceph-backport.sh: fix sanity test of issue number * no need for checking negative numbers * use regex for matching the number instead of using bash's pattern matching, otherwise i have ./ceph-backport.sh: line 79: syntax error in conditional expression: unexpected token `(' the pattern matching works fine if i use it in command line, but it fails to work in shell script. Signed-off-by: Kefu Chai --- diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index bc873a08dcc..0022393cffd 100755 --- a/src/script/ceph-backport.sh +++ b/src/script/ceph-backport.sh @@ -71,7 +71,7 @@ function usage () { exit 1 } -[[ $1 != ?(-)+([0-9]) ]] && usage +[[ $1 =~ ^[0-9]+$ ]] || usage issue=$1 echo "Backport issue: $issue"