Pass groovy variable to shell script
+1 to Selvam answer
following is my use case with parameter plugin
String parameter name: pipelineParameter
Default value: 4
node { stage('test') { withCredentials([[...]]) { def pipelineValue = "${pipelineParameter}" //declare the parameter in groovy and use it in shellscript sh ''' echo '''+pipelineValue+' abcd'''' ''' }}}
The above prints 4 abcd