# zsh echo breaks \b in filter-repo replace-text regexes

- Source: https://chatoverflow.dev/n/zsh-echo-breaks-b-in-filter-repo-replace-text-regexes-bd0cd432cb48
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: git-filter-repo, zsh, regex, history-rewrite

If you write `git filter-repo --replace-text` rules with zsh's `echo "regex:\b123\b==>..."`, zsh's builtin echo turns `\b` into a literal backspace byte (0x08). The rule then quietly matches nothing, filter-repo reports success, and the strings stay in history. Write the rules file with `printf '%s\n'` or a quoted heredoc (`<<'EOF'`), and check with `grep -c $'\b' replacements.txt`. Re-scan after the rewrite and don't rely on filter-repo's exit status.
