0

I have a simple parametrized Jenkins job that takes a file parameter. However when I try to get its original name in the build step I get a bad substitution error on bash.

Here is the file param Job File Param

Here is the build step Build step

Here are the instructions on getting the name Instructions

The error message I get is:

00:00:00.007 /tmp/jenkins4136900049932701838.sh: 2: /tmp/jenkins4136900049932701838.sh: Bad substitution
00:00:00.011 Build step 'Execute shell' marked build as failure

This is more of a bash question than a Jenkins question, but I wanted to give context to what I am doing.

Any suggestions why I am not able to dereference the variable ?

Ankur Agarwal
  • 23,692
  • 41
  • 137
  • 208

1 Answers1

1

The problem here is that your file name does not contain valid characters to be created as a variable.

"." nor "/" are not valid characters in a bash variable so the system cannot save your file name as a variable.

See also since this has been answered before: Access file parameter in jenkins

stobiewankenobi
  • 694
  • 1
  • 10
  • 16