diff --git a/Jenkinsfile b/Jenkinsfile index ac49afcb946db5f86097c662679b43a918d624f4..41cbb15351b7c7c17445bd5ea7ee37123450d71a 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 0000000000000000000000000000000000000000..6a28dff2e05afd5f048ca9ea5d3ef2f980ef9452 --- /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