Running a shell command from a certain folder in the Jenkins' dynamic parameter script
I used the Jenkins' Dynamic parameter in order to generate date for a job but that is very easy to do.
While googling, I have found that the way to run a shell command is as follows:
"<some shell command>".execute(null, new File("<path to where you want to run the command from>")).text
The above overload of the execute function uses two parameters. The first one is irrelevant for this topic and the second one is actually what I needed. It sets the command to run under that path.
Hope that helps someone.