From 5696085611494b0aaddd126417705277284ff7dd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 28 Mar 2019 11:57:21 +0800 Subject: [PATCH] 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 --- src/script/ceph-backport.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" -- 2.39.5