How to parse through branchname so that the branch name can be extracted for further processing?
branchname=$(git status 2>&1)
Parse branchname
to extract test_pbx_voice_chanls_e1_WIP
in another variable.
From the output shown below, I an trying to extract the name after 'On branch' to be used in other steps in the script.
Output at the prompt:
testing@test:~/linuxprompt-test$ git status
On branch test_pbx_voice_chanls_e1_WIP
Your branch is up-to-date with 'origin/test_pbx_voice_chanls_e1_WIP'