for x do tr -d ' ' < $x > _tmp_ mv _tmp_ $x ex - $x <<\END %s/\\$/XYzzY/ %s/\\/\//g %s/XYzzY/\\/ wq END done