in reply to Why I can't remove trailing slash
Also note that $\ is a variable to be interpolated in double quotes. \b also has a special meaning (chr 8).