fancy-linux-prompt
fancy-linux-prompt copied to clipboard
grep: warning: stray \ before d
When I enter a number of Git repositories, I see:
grep: warning: stray \ before d
grep: warning: stray \ before d
grep: warning: stray \ before d
grep: warning: stray \ before d
before the prompt. It looks like:
# how many commits local branch is ahead/behind of remote?
stats="$(git status --porcelain --branch | grep '^##' | grep -o '\[.\+\]$')"
aheadN="$(echo "$stats" | grep -o 'ahead \d\+' | grep -o '\d\+')"
behindN="$(echo "$stats" | grep -o 'behind \d\+' | grep -o '\d\+')"
is not working as expected.
Solved by using [[:digit:]] instead of \d
Hopefully @pombadev will review, accept, and merge this fix.
Hey @pombadev, what are your thoughts on this fix?