I would like some clarity on the different types of quotes in workflow 
script. Take this contrived example: 

env.FOO = 42
def FOO2 = 43

node {
  sh 'echo $FOO'
  sh "echo $FOO2"
}

This works - as you would expect. However, if you switch the quotes around, 
it fails. It seems single quote means that jenkins won't expand it and 
instead it will be passed directly to the shell (whence the environment 
variable is available). In the second shell script, the double quotes mean 
that Jenkins expands it based on variables in scope. If you make it single 
quote, there is no variable in the shell environment. 

Is this deliberate behavior, and have I understood it correctly? 

-- 
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 
https://groups.google.com/d/msgid/jenkinsci-users/87d96032-8670-4fc2-b81c-bc57bb8f6527%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to