I've never used 2x doublequote string in Groovy, but in any case this sounds like a Groovy question.
Aside from String formatting like ${...}, you can also explicitly set a value to environment variable by: env.MYDIR= pwd() then every process forked within the block scope will have such an environment variable set. 2014-12-08 1:09 GMT-08:00 Rupali <rupalite...@gmail.com>: > Hi, > > I tried reading variables in batch script. It works if its a single line > batch code, but doesn't for multiple lines. > > e.g. > > Below outputs current directory path correctly. > node('windows') { > def myDir = pwd() > bat "echo ${myDir}" > } > > But below produces output as *Current directory is: ${myDir}* > node('windows') { > def myDir = pwd() > bat '''echo "Current directory is:" > echo ${myDir}''' > } > > Am I missing some syntax in multiple line batch script? > > Regards, > Rupali > > -- > 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/a8162919-a986-463a-ad1d-a54c1d75d352%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/a8162919-a986-463a-ad1d-a54c1d75d352%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Kohsuke Kawaguchi -- 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/CAN4CQ4zJn56MYfqy_9a5RAepw1iarsmJAd2maCRoR%3DmvuaX%2Byg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.