Remove some duplicate commands; allow escapes on `$` signs.