From d5f58f6b2f8a2a30009852fe2b2c09e7f64b7235 Mon Sep 17 00:00:00 2001 From: zhangdd <86431843@qq.com> Date: Thu, 1 Apr 2021 09:23:22 +0800 Subject: [PATCH] test Signed-off-by: zhangdd <86431843@qq.com> --- Jenkinsfile | 7 +------ test.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 test.sh diff --git a/Jenkinsfile b/Jenkinsfile index ac49afc..41cbb15 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,12 +5,7 @@ node{ script{ def pom = readMavenPom file: 'pom.xml' echo "start echo pom" - echo "${pom}" - arr=(${pom}) - for s in ${arr[@]} - do - echo "$s" - done + echo "$pom" echo "end echo pom" } diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..6a28dff --- /dev/null +++ b/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash +string='com.schbrain.kp:test:jar:0.0.1-SNAPSHOT' +#对IFS变量 进行替换处理 +OLD_IFS="$IFS" +IFS=":" +array=($string) +IFS="$OLD_IFS" + +for var in ${array[@]} +do + echo $var +done -- GitLab