I'm using latest version of Jenkins from official docker repo. And currently it's not possible to execute a code in the bash shell. It always executes in /bin/sh instead (which in Ubuntu is a link to dash shell).
The following code give me - "/bin/sh".
I have tested the same project (a simple freestyle job) on Jenkins 1.65x and it works fine.