Skip to main content
1 of 2
l0b0
  • 53.6k
  • 48
  • 225
  • 398

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
l0b0
  • 53.6k
  • 48
  • 225
  • 398