From 794c7030aef1e8b60de5d0900b3e71f9c972d04d Mon Sep 17 00:00:00 2001 From: George Joseph Date: Thu, 8 Aug 2019 11:10:11 -0600 Subject: [PATCH] CI: Escape backslashes in printenv/sort/tr Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94 --- tests/CI/gates.jenkinsfile | 2 +- tests/CI/periodics-daily.jenkinsfile | 2 +- tests/CI/ref_debug.jenkinsfile | 2 +- tests/CI/unittests.jenkinsfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile index e135656452..c065dd9774 100644 --- a/tests/CI/gates.jenkinsfile +++ b/tests/CI/gates.jenkinsfile @@ -100,7 +100,7 @@ pipeline { withCredentials([usernamePassword(credentialsId: "${JENKINS_GERRIT_CREDS}", passwordVariable: 'GERRIT_USER_PW', usernameVariable: 'GERRIT_USER_NAME')]) { - sh "printenv -0 | sort -z | tr '\0' '\n'" + sh "printenv -0 | sort -z | tr '\\0' '\\n'" checkout scm: [$class: 'GitSCM', branches: [[name: env.GERRIT_BRANCH ]], diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile index 1dba606e70..42b4615c4a 100644 --- a/tests/CI/periodics-daily.jenkinsfile +++ b/tests/CI/periodics-daily.jenkinsfile @@ -43,7 +43,7 @@ pipeline { stage ("Checkout") { sh "sudo chown -R jenkins:users ." - sh "printenv -0 | sort -z | tr '\0' '\n'" + sh "printenv -0 | sort -z | tr '\\0' '\\n'" sh "sudo tests/CI/setupJenkinsEnvironment.sh" } diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile index 82ace49246..d314bbd218 100644 --- a/tests/CI/ref_debug.jenkinsfile +++ b/tests/CI/ref_debug.jenkinsfile @@ -43,7 +43,7 @@ pipeline { stage ("Checkout") { sh "sudo chown -R jenkins:users ." - sh "printenv -0 | sort -z | tr '\0' '\n'" + sh "printenv -0 | sort -z | tr '\\0' '\\n'" sh "sudo tests/CI/setupJenkinsEnvironment.sh" } diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile index 793d634374..f868723598 100644 --- a/tests/CI/unittests.jenkinsfile +++ b/tests/CI/unittests.jenkinsfile @@ -100,7 +100,7 @@ pipeline { withCredentials([usernamePassword(credentialsId: "${JENKINS_GERRIT_CREDS}", passwordVariable: 'GERRIT_USER_PW', usernameVariable: 'GERRIT_USER_NAME')]) { - sh "printenv -0 | sort -z | tr '\0' '\n'" + sh "printenv -0 | sort -z | tr '\\0' '\\n'" checkout scm: [$class: 'GitSCM', branches: [[name: env.GERRIT_BRANCH ]], -- 2.47.2