![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Add a newline to the end of a fileby jmcnamara (Monsignor) |
on Nov 28, 2002 at 11:25 UTC ( #216282=snippet: print w/replies, xml ) | Need Help?? |
gcc 3.x complains if a source or header file doesn't have a newline at the end: $ gcc -c no_eof.c no_eof.c:9:2: warning: no newline at end of file The following snippet will fix that for one or more files: perl -i -pl -eof file1 file2 ... The following is an alternative approach: perl -i -pe '$_ .= $/ if eof and not /\n/' file1 file2 ...
|
|