Bash – substitute substring in a string
Today I came across interesting issue – how to remove part of the string containing slash. Full string:
1 |
refs/heads/releases/10 |
The desired goal is to extract releases/10 from the string. Code:
1 2 |
fullString=refs/heads/releases/10 echo ${fullString#refs/heads/} |
And here we go:
1 |
releases/10 |