Hello,

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8d8356af-d32f-491a-9e5c-3dab8b0ff257%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to