I've been experimenting with creating a new pipeline, using the built-in pipeline editor (i.e. not from SCM). The strange bit is that, when I run any sh step, I receive the following error:

sh: 1: Syntax error: end of file unexpected (expecting "done")

This comes from the following MWE:

pipeline {
    agent any

    stages {
        stage('Test') {
            steps {
                sh 'echo "FOO!"'

The odd bit is that my pipeline scripts that are coming from SCM are working just fine, despite the fact that they have loads of shell scripts.

Running Jenkins 2.73.2.

1 Answer 1


Apparently this was caused by the pipeline name having an apostrophe character in it. Renaming the build solved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.