can't see the error in this piece of bash script
by doodahjones from LinuxQuestions.org on (#5SSS8)
Learning VSCode, and found I need to understand git first. This is part of a script to get that famous git bash prompt (the one with the git info in it) I saw in a tutorial done on Windows. Comes from a reddit user.
Seems to be an error at the very end, as below.
This is the error message:
Code:line 135: syntax error near unexpected token \ 'then'Code:line 135:parse_git_branch (){
branch=$(git branch 2> /dev/null | grep -e '* ' | sed 's/..(.*)/[\1]/') if [ -n "$branch" ]; then echo $branch$(git_status)
fi
}I'm just beginning to figure this stuff out but this has me beat. Can someone see the boo-boo?
Seems to be an error at the very end, as below.
This is the error message:
Code:line 135: syntax error near unexpected token \ 'then'Code:line 135:parse_git_branch (){
branch=$(git branch 2> /dev/null | grep -e '* ' | sed 's/..(.*)/[\1]/') if [ -n "$branch" ]; then echo $branch$(git_status)
fi
}I'm just beginning to figure this stuff out but this has me beat. Can someone see the boo-boo?