From: eculp <ec...@un...> - 2007-11-07 12:31:56
|
Quoting Peter Moulding <pe...@pe...>: > I find a few PHP files with spaces at the end. ConnectDB.inc in 3.08 has > one. What is the easiest way for me to help erase those spaces? Hi Peter, Just curious, what kind of problems are they causing? If you are running a variaty of unix/bsd/linux/solaris you could jusr =20 write a simple shell script and regex using sed and save the modified =20 version. In any other operating system, I have no idea. When I =20 eliminate spaces I often do tabs at the same time so that they don't =20 slip by me. Something like # egrep -lr '[ ]{1,}*$' * or with grep ( a bit older ) there is a [tab and a space] between the []. # grep -lr '[ ][ ]*$' * will recursively list the files that have spaces or tabs in the PWD. =20 A sed script can remove them and your script can save the modified =20 version separately. a sed script that will need to be redirected to save a modified copy =20 without spaces and or tabs. sed 's/[ ][ ]*$//' * You would redirect it to a new file that will be clean of tabs and =20 spaces at the end of lines. If that works for you and you need a simple but complete script to =20 start from, I'm sure most anyone here can throw one together as a =20 model for you. But, of course, with standard disclaimers ;) In fact, if there is a valid reason, it might be a better idea to just =20 remove them from the repository and make life easier for all. Hope that helps, ed > > Peter Moulding > > Helping you help your customers > > Web: PeterMoulding.com > Trainer: Now in Australia, the workshops enjoyed in America > and Europe. > Web Architect: Increase sales. > Retain customers. > Decrease costs. > Proven 1000% effective. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > |