Skip to content

Instantly share code, notes, and snippets.

🛠
Twenty-four hours a day, seven days a week, no job is too big, no FEE is too big

magnayn

🛠
Twenty-four hours a day, seven days a week, no job is too big, no FEE is too big
  • Oxford, UK
Block or report user

Report or block magnayn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active Dec 5, 2019
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
You can’t perform that action at this time.