I have been trying to get the remove "origin" from branch name in JenkinsFile sh script using
steps {
sh """#!/bin/bash
echo '${GIT_BRANCH\#*/}'
"""
}
I have tried replacing it with based on other suggestions but did not succeed.
"${GIT_BRANCH\#*/}" "${GIT_BRANCH#*/}" '${GIT_BRANCH\#*/}' '${GIT_BRANCH#*/}'
All come with error:
WorkflowScript: 80: unexpected char: '#' @ line 80, column 38.
echo ${GIT_BRANCH#*/}
or
WorkflowScript: 80: unexpected char: '\' @ line 80, column 38.
echo ${GIT_BRANCH\#*/}
Running in Jenkins jenkins/jenkins:2.418 Any hints?