In the below command I would like to replace the 076162636461610d with the variable serialdata.
I've tried ${serialdata} and $[serialdata] neither work.
I also tried, without success:
As is, you've instead create a closure (with the curly braces) that ... does IDK what but definitely not what you intend.
Same thing here:
Otherwise, you've done the same (in this case, probably defined in a variable serialdata interpreted as Double due to the d at the end and with octal representation given the 0 at the beginning -- and happening to have only valid octal digits in between -- tricks you can use to force different interpretation of literal values in Groovy).
Otherwise, your string interpolation looks correct!