Text streams like this should be read using a while loop rather than for, which is probably causing the issue. A simple way to do this:
git branch | grep -v master | while IFS= read -r line
do
echo "${line:2}"
done
Text streams like this should be read using a while loop rather than for, which is probably causing the issue. A simple way to do this:
git branch | grep -v master | while IFS= read -r line
do
echo "${line:2}"
done