I would like to define a variable in shell and to use it.
How can I do this?

For example:

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#/${env.VERSION}/g\' \$arg/0/package.json; done' _ 
{} +"

The content of VERSION is the result of a grep from file. I displayed the 
variable, it works.
Now I would like to use VERSION in the sed part. But I am not able to get 
the value of VERSION.
I tried ${env.VERSION}, ${VERSION}, $VERSION, ...

Thanks for your help on this topic.

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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to