Ah yes of course, thanks. Same as ruby. 


On Tuesday, December 1, 2015 at 9:09:55 AM UTC+11, slide wrote:
>
> This is the behavior of the groovy language. Variables are interpolated in 
> double quoted strings, but not in single quoted strings.
>
> On Mon, Nov 30, 2015 at 3:06 PM Michael Neale <michae...@gmail.com 
> <javascript:>> wrote:
>
>> 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-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/87d96032-8670-4fc2-b81c-bc57bb8f6527%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/87d96032-8670-4fc2-b81c-bc57bb8f6527%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/d9799ef3-800a-4872-ab70-e39d3aff43a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to