#!/bin/sh find "$DEV" -name '*.cpp' -o -name '*.h' -o -name '*.c' | \ perl -lne'sysopen(Z,$_,0) && sysseek(Z,-1,2) && sysread(Z,$c,1) && close(Z) or warn("$_: $!\n"),next;$c eq "\n" or s/ /\\ /g,print' | \ xargs perl -i -lpe'eof && warn "Fixed $ARGV\n"'