, String groovy, "/" "/" , , , .
, linux sed, (, sed .env).
Jenkins Pipeline Groovy:
String s = "A/B/C"
your_variable = s.replace("/", "\\/")
sh "sed -i -e 's/string_to_replace/${your_variable}/g' path/to/file/.env"
. ${your_variable} .
:
echo "Your variable new content: ${your_variable}"
:
Your variable new content: A\/B\/C