Article 4Q0HA Groovy to Linux variable

Groovy to Linux variable

by
flukeyLinux
from LinuxQuestions.org on (#4Q0HA)
Hello all,
I'm struggling to convert a groovy variable to use in a bash command. Any help would be great. Can anyone see what I am doing wrong?

def teamname = "${loweritam}"
sh '''
appteam="""$teamname-REL"""
team=ap123456
echo $appteam $team
'''
Output:
+ appteam=-REL
+ team=ap123456
+ echo -REL ap123456
-REL ap123456

appteam should look like - 12345tr-REL
I've tried using single quotes like so: appteam='''+teamname+'-REL''''

but that does not work for me either.

thanks,
Flukelatest?d=yIl2AUoC8zA latest?i=pcKSVRUF15U:IOamBEDym7Q:F7zBnMy latest?i=pcKSVRUF15U:IOamBEDym7Q:V_sGLiP latest?d=qj6IDK7rITs latest?i=pcKSVRUF15U:IOamBEDym7Q:gIN9vFwpcKSVRUF15U
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments