Jason Van Cleve wrote: > I'd like to process a whole bunch of source files uniformly, stripping > off any whitespace at the ends of lines and also making sure there is > exactly one newline before the EOF. That last part may be tricky, but > is there a speedy *nix utility for getting rid of trailing whitespace, > or maybe for general source code processing?
You got several good scripts to strip whitespace from the ends of lines, but I didn't see any code to strip trailing blank lines. How about this? $ python -c 'import sys; print sys.stdin.read().rstrip()' < in > out That doesn't trim EOL whitespace, just EOF whitespace. Combine it with one of the other scripts for EOL trimming. -- Bob Miller K<bob> kbobsoft software consulting http://kbobsoft.com [EMAIL PROTECTED] _______________________________________________ EUGLUG mailing list euglug@euglug.org http://www.euglug.org/mailman/listinfo/euglug