Issue
String arg1 = "arg1" String arg2 = "arg2" String cm = "curl -H \\'Authorization: ${arg1}\\' -H \\'X-CUSTOM-HEADER:${arg2}\\' www.google.com" node { sh cm }
The expected output is:
[Pipeline] { [Pipeline] sh + curl -H 'Authorization: arg1' -H 'X-CUSTOM-HEADER:arg2' www.google.com
Actual output is:
Output: [Pipeline] sh + curl -H ''\''Authorization:' 'arg1'\''' -H ''\''X-CUSTOM-HEADER:arg2'\''' www.google.com
Environment
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
-
CloudBees CI (CloudBees Core) on traditional platforms - Client controller
-
CloudBees Jenkins Enterprise - Managed controller