Skip to content

Instantly share code, notes, and snippets.

View alesso-x's full-sized avatar
🎯
Focusing

Alesso alesso-x

🎯
Focusing
View GitHub Profile
@alesso-x
alesso-x / Jenkinsfile.groovy
Created January 16, 2018 00:14 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'No quotes in single backticks'
sh 'echo $BUILD_NUMBER'
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"'
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"'
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"'
echo 'Using three backslashes still results in preserving the single quotes'