In your case you just need to escape \$VERSION to avoid the GString to be 

sh "find packages -name internal-* -type d -exec bash -c 'for arg; do 
export VERSION=\$(grep \${arg##*/} nexus-cicd-versions.txt | cut -d: 
-f2);sed -i \'s/#VERSION#/\${VERSION}/g\' \$arg/0/package.json; done' _ {} 

But again, GString might be a bit tricky when escaping in the sh step 
within the  jenkins pipeline


You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To view this discussion on the web visit
For more options, visit

Reply via email to