Reputation: 1063
This appears to be a really weird issue. I am using Jenkins for automating compilation and build creation. I have a shell script which when I execute manually on gitserver, it is fine but the same script through Jenkins displays error:
/tmp/hudson829990263989049539.sh: 2: build/envsetup.sh: Syntax error: "(" unexpected
Content of the shell script(envsetup.sh):
#!/bin/sh
function hmm()
{
cat <<EOF
..................
Command used for manual as well as with Jenkins:
. build/envsetup.sh
I tried various methods e.g. changing the path for script execution, chown and then execute, dos2unix etc but nothing appears to work till now.
Any idea on this? Thanks in advance.
Upvotes: 0
Views: 1068
Reputation: 1063
The issue got resolved when I put
#!/bin/bash
in the the build steps in Jenkins.
Upvotes: 2